summaryrefslogtreecommitdiff
path: root/fxjs/ijs_runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/ijs_runtime.cpp')
-rw-r--r--fxjs/ijs_runtime.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/fxjs/ijs_runtime.cpp b/fxjs/ijs_runtime.cpp
index 03538cd7b5..79238bfe11 100644
--- a/fxjs/ijs_runtime.cpp
+++ b/fxjs/ijs_runtime.cpp
@@ -31,8 +31,10 @@ void IJS_Runtime::Destroy() {
std::unique_ptr<IJS_Runtime> IJS_Runtime::Create(
CPDFSDK_FormFillEnvironment* pFormFillEnv) {
#ifdef PDF_ENABLE_V8
- return pdfium::MakeUnique<CJS_Runtime>(pFormFillEnv);
-#else
- return pdfium::MakeUnique<CJS_RuntimeStub>(pFormFillEnv);
+ if (pFormFillEnv->IsJSPlatformPresent())
+ return pdfium::MakeUnique<CJS_Runtime>(pFormFillEnv);
#endif
+ return pdfium::MakeUnique<CJS_RuntimeStub>(pFormFillEnv);
}
+
+IJS_Runtime::~IJS_Runtime() = default;