From a1c1c63d3454e51ec321cdaa6e3420db2ed6c957 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 17 Jul 2018 21:34:27 +0000 Subject: M68: Use JSGetObject() in even more places. This is a manual merge of commit 6aa2190. BUG=chromium:862059 Change-Id: Iae0069f1532adc8aea3ac865a4242b00b84d632b Reviewed-on: https://pdfium-review.googlesource.com/38050 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- fxjs/cjs_global.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp index bf0f5efc10..2c95f672b8 100644 --- a/fxjs/cjs_global.cpp +++ b/fxjs/cjs_global.cpp @@ -37,11 +37,10 @@ void JSSpecialPropQuery(const char*, if (!pRuntime) return; - CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast(pJSObj); CJS_Return result = pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str()); info.GetReturnValue().Set(!result.HasError() ? 4 : 0); @@ -56,11 +55,10 @@ void JSSpecialPropGet(const char* class_name, if (!pRuntime) return; - CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast(pJSObj); CJS_Return result = pObj->GetProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str()); if (result.HasError()) { @@ -83,11 +81,10 @@ void JSSpecialPropPut(const char* class_name, if (!pRuntime) return; - CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast(pJSObj); CJS_Return result = pObj->SetProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value); if (result.HasError()) { @@ -105,11 +102,10 @@ void JSSpecialPropDel(const char* class_name, if (!pRuntime) return; - CJS_Object* pJSObj = pRuntime->GetObjectPrivate(info.Holder()); - if (!pJSObj) + Alt* pObj = JSGetObject(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast(pJSObj); CJS_Return result = pObj->DelProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str()); if (result.HasError()) { -- cgit v1.2.3