Index: fpdfsdk/src/javascript/JS_Runtime.cpp |
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp |
index b26f5a2e6211b8081a07fe3cd82127d5c2b39a8f..f21819ac17424cc80bb88dbf6899769bb756e6d0 100644 |
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp |
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp |
@@ -35,7 +35,11 @@ IFXJS_Runtime* CJS_RuntimeFactory::NewJSRuntime(CPDFDoc_Environment* pApp) |
{ |
if (!m_bInit) |
{ |
- JS_Initial(); |
+ unsigned int embedderDataSlot = 0; |
+ if (pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) { |
+ embedderDataSlot = pApp->GetFormFillInfo()->m_pJsPlatform->m_v8EmbedderSlot; |
+ } |
+ JS_Initial(embedderDataSlot); |
m_bInit = TRUE; |
} |
return new CJS_Runtime(pApp); |