diff options
Diffstat (limited to 'fxjs/cjs_publicmethods.cpp')
-rw-r--r-- | fxjs/cjs_publicmethods.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp index d37706c973..678aca5317 100644 --- a/fxjs/cjs_publicmethods.cpp +++ b/fxjs/cjs_publicmethods.cpp @@ -120,8 +120,11 @@ template <CJS_Return (*F)(CJS_Runtime*, const std::vector<v8::Local<v8::Value>>&)> void JSGlobalFunc(const char* func_name_string, const v8::FunctionCallbackInfo<v8::Value>& info) { - CJS_Runtime* pRuntime = - CJS_Runtime::RuntimeFromIsolateCurrentContext(info.GetIsolate()); + CJS_Object* pObj = CFXJS_Engine::GetObjectPrivate(info.Holder()); + if (!pObj) + return; + + CJS_Runtime* pRuntime = pObj->GetRuntime(); if (!pRuntime) return; |