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 <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index bf0f5ef..2c95f67 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -37,11 +37,10 @@
   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 @@
   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 @@
   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 @@
   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()) {