Index: fpdfsdk/src/javascript/JS_Runtime.cpp |
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp |
index c2c1a5140070ec387e6a6be207cd4d5e09306ca0..6ceb640e5881186ac4d63e03eb7b364da81c38bb 100644 |
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp |
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp |
@@ -110,13 +110,19 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment * pApp) : |
m_pDocument(NULL), |
m_bBlocking(FALSE), |
m_bRegistered(FALSE), |
- m_pFieldEventPath(NULL) |
+ m_pFieldEventPath(NULL), |
+ m_isolate(NULL) |
{ |
- m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); |
+ if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) { |
+ m_isolate = m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate; |
+ } |
+ if (!m_isolate) { |
+ m_pArrayBufferAllocator.reset(new CJS_ArrayBufferAllocator()); |
- v8::Isolate::CreateParams params; |
- params.array_buffer_allocator = m_pArrayBufferAllocator.get(); |
- m_isolate = v8::Isolate::New(params); |
+ v8::Isolate::CreateParams params; |
+ params.array_buffer_allocator = m_pArrayBufferAllocator.get(); |
+ m_isolate = v8::Isolate::New(params); |
+ } |
InitJSObjects(); |