From ce84f7162c70fcabd2b3d486b9c19dac9b3754ed Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 30 May 2017 17:17:33 -0700 Subject: CFXJS_Engine::GetObjDefnID is a static method So call it as such. Fix two places where we're invoking it off of an intance. Change-Id: I08712fa27dbdf85c9195cedcc62d7d741b0ad091 Reviewed-on: https://pdfium-review.googlesource.com/6110 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/javascript/Document.cpp | 2 +- fxjs/fxjs_v8.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp index a760ad9956..5d5c2b5d6b 100644 --- a/fpdfsdk/javascript/Document.cpp +++ b/fpdfsdk/javascript/Document.cpp @@ -1211,7 +1211,7 @@ bool Document::addIcon(CJS_Runtime* pRuntime, } v8::Local pJSIcon = params[1].ToV8Object(pRuntime); - if (pRuntime->GetObjDefnID(pJSIcon) != CJS_Icon::g_nObjDefnID) { + if (CFXJS_Engine::GetObjDefnID(pJSIcon) != CJS_Icon::g_nObjDefnID) { sError = JSGetStringFromID(IDS_STRING_JSTYPEERROR); return false; } diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index 10aa51395e..7f5e5cb8b5 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -171,15 +171,16 @@ void V8TemplateMapTraits::Dispose(v8::Isolate* isolate, v8::Local obj = value.Get(isolate); if (obj.IsEmpty()) return; - CFXJS_Engine* pEngine = CFXJS_Engine::CurrentEngineFromIsolate(isolate); - int id = pEngine->GetObjDefnID(obj); + int id = CFXJS_Engine::GetObjDefnID(obj); if (id == -1) return; CFXJS_ObjDefinition* pObjDef = CFXJS_ObjDefinition::ForID(isolate, id); if (!pObjDef) return; - if (pObjDef->m_pDestructor) - pObjDef->m_pDestructor(pEngine, obj); + if (pObjDef->m_pDestructor) { + pObjDef->m_pDestructor(CFXJS_Engine::CurrentEngineFromIsolate(isolate), + obj); + } CFXJS_Engine::FreeObjectPrivate(obj); } -- cgit v1.2.3