diff options
Diffstat (limited to 'fxjs/fxjs_v8.cpp')
-rw-r--r-- | fxjs/fxjs_v8.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index c9d227cc47..f1555b2e96 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -436,7 +436,7 @@ void CFXJS_Engine::ReleaseEngine() { if (!pData) return; - ClearConstArray(); + m_ConstArrays.clear(); int maxID = CFXJS_ObjDefinition::MaxID(GetIsolate()); for (int i = 0; i < maxID; ++i) { @@ -561,3 +561,12 @@ void* CFXJS_Engine::GetObjectPrivate(v8::Local<v8::Object> pObj) { } return pData ? pData->m_pPrivate : nullptr; } + +v8::Local<v8::Array> CFXJS_Engine::GetConstArray(const WideString& name) { + return v8::Local<v8::Array>::New(GetIsolate(), m_ConstArrays[name]); +} + +void CFXJS_Engine::SetConstArray(const WideString& name, + v8::Local<v8::Array> array) { + m_ConstArrays[name] = v8::Global<v8::Array>(GetIsolate(), array); +} |