Use JSGetObject() in even more places.

BUG=chromium:862059

Change-Id: Id354a5e6dbc037dbb76f901de8311a4f4a4d8940
Reviewed-on: https://pdfium-review.googlesource.com/37670
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index e3c347e..c9afdcb 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -32,16 +32,16 @@
 void JSSpecialPropQuery(const char*,
                         v8::Local<v8::String> property,
                         const v8::PropertyCallbackInfo<v8::Integer>& info) {
-  CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
-  if (!pJSObj)
+  Alt* pObj = JSGetObject<Alt>(info.Holder());
+  if (!pObj)
     return;
 
-  CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+  CJS_Runtime* pRuntime = pObj->GetRuntime();
   if (!pRuntime)
     return;
 
-  CJS_Return result = static_cast<Alt*>(pJSObj)->QueryProperty(
-      PropFromV8Prop(info.GetIsolate(), property).c_str());
+  CJS_Return result =
+      pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str());
 
   info.GetReturnValue().Set(!result.HasError() ? 4 : 0);
 }
@@ -50,15 +50,15 @@
 void JSSpecialPropGet(const char* class_name,
                       v8::Local<v8::String> property,
                       const v8::PropertyCallbackInfo<v8::Value>& info) {
-  CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
-  if (!pJSObj)
+  Alt* pObj = JSGetObject<Alt>(info.Holder());
+  if (!pObj)
     return;
 
-  CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+  CJS_Runtime* pRuntime = pObj->GetRuntime();
   if (!pRuntime)
     return;
 
-  CJS_Return result = static_cast<Alt*>(pJSObj)->GetProperty(
+  CJS_Return result = pObj->GetProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
 
   if (result.HasError()) {
@@ -75,15 +75,15 @@
                       v8::Local<v8::String> property,
                       v8::Local<v8::Value> value,
                       const v8::PropertyCallbackInfo<v8::Value>& info) {
-  CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
-  if (!pJSObj)
+  Alt* pObj = JSGetObject<Alt>(info.Holder());
+  if (!pObj)
     return;
 
-  CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+  CJS_Runtime* pRuntime = pObj->GetRuntime();
   if (!pRuntime)
     return;
 
-  CJS_Return result = static_cast<Alt*>(pJSObj)->SetProperty(
+  CJS_Return result = pObj->SetProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value);
 
   if (result.HasError()) {
@@ -96,15 +96,15 @@
 void JSSpecialPropDel(const char* class_name,
                       v8::Local<v8::String> property,
                       const v8::PropertyCallbackInfo<v8::Boolean>& info) {
-  CJS_Object* pJSObj = CFXJS_Engine::GetObjectPrivate(info.Holder());
-  if (!pJSObj)
+  Alt* pObj = JSGetObject<Alt>(info.Holder());
+  if (!pObj)
     return;
 
-  CJS_Runtime* pRuntime = pJSObj->GetRuntime();
+  CJS_Runtime* pRuntime = pObj->GetRuntime();
   if (!pRuntime)
     return;
 
-  CJS_Return result = static_cast<Alt*>(pJSObj)->DelProperty(
+  CJS_Return result = pObj->DelProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
   if (result.HasError()) {
     // TODO(dsinclair): Should this set the pRuntime->Error result?