diff options
author | Lei Zhang <thestig@chromium.org> | 2018-07-17 21:34:27 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-17 21:34:27 +0000 |
commit | a1c1c63d3454e51ec321cdaa6e3420db2ed6c957 (patch) | |
tree | e72e49ac8ec637c7f3f506bbaaab8ca83dccb276 | |
parent | b6b5a2dcd7cc4302d5f20e21ab637be1b03d1019 (diff) | |
download | pdfium-chromium/3440.tar.xz |
M68: Use JSGetObject() in even more places.chromium/3440
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 <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r-- | fxjs/cjs_global.cpp | 20 |
1 files 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<Alt>(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast<Alt*>(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<Alt>(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast<Alt*>(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<Alt>(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast<Alt*>(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<Alt>(pRuntime, info.Holder()); + if (!pObj) return; - Alt* pObj = static_cast<Alt*>(pJSObj); CJS_Return result = pObj->DelProperty( pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str()); if (result.HasError()) { |