diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-14 23:40:10 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-14 23:40:10 +0000 |
commit | 55ccb526913debb3269a33792bbd61b05656ec46 (patch) | |
tree | a98152baf9d4a5dcf1c76ecaf53cbae35720d2b8 /fxjs/cfxjs_engine.cpp | |
parent | 48d62c3a5f57eb3397a335bea4a5a30de2fcb955 (diff) | |
download | pdfium-55ccb526913debb3269a33792bbd61b05656ec46.tar.xz |
Remove optional argument from NewFXJSBoundObject().
Additionally, we have a pre-existing enum type that is more
meaningful than just a boolean.
Change-Id: Ie6ad13a3c9b22e34dedf7a5a9b5b9cc2a49b1f03
Reviewed-on: https://pdfium-review.googlesource.com/40190
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cfxjs_engine.cpp')
-rw-r--r-- | fxjs/cfxjs_engine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fxjs/cfxjs_engine.cpp b/fxjs/cfxjs_engine.cpp index 8587b8af98..2a95e4c58d 100644 --- a/fxjs/cfxjs_engine.cpp +++ b/fxjs/cfxjs_engine.cpp @@ -467,7 +467,7 @@ void CFXJS_Engine::InitializeEngine() { } } else if (pObjDef->m_ObjType == FXJSOBJTYPE_STATIC) { v8::Local<v8::String> pObjName = NewString(pObjDef->m_ObjName); - v8::Local<v8::Object> obj = NewFXJSBoundObject(i, true); + v8::Local<v8::Object> obj = NewFXJSBoundObject(i, FXJSOBJTYPE_STATIC); if (!obj.IsEmpty()) { v8Context->Global()->Set(v8Context, pObjName, obj).FromJust(); m_StaticObjects[i] = v8::Global<v8::Object>(GetIsolate(), obj); @@ -542,7 +542,7 @@ Optional<IJS_Runtime::JS_Error> CFXJS_Engine::Execute( } v8::Local<v8::Object> CFXJS_Engine::NewFXJSBoundObject(int nObjDefnID, - bool bStatic) { + FXJSOBJTYPE type) { v8::Isolate::Scope isolate_scope(GetIsolate()); v8::Local<v8::Context> context = GetIsolate()->GetCurrentContext(); FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(GetIsolate()); @@ -562,7 +562,7 @@ v8::Local<v8::Object> CFXJS_Engine::NewFXJSBoundObject(int nObjDefnID, if (pObjDef->m_pConstructor) pObjDef->m_pConstructor(this, obj); - if (!bStatic) { + if (type == FXJSOBJTYPE_DYNAMIC) { auto* pIsolateData = FXJS_PerIsolateData::Get(GetIsolate()); if (pIsolateData->m_pDynamicObjsMap) pIsolateData->m_pDynamicObjsMap->SetAndMakeWeak(pObjData, obj); |