Index: fpdfsdk/src/javascript/global.cpp |
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp |
index 97a74e792de2ec2d8997f6b4eb46e5378de35e04..403cf58ebf04e30de95f46c1ddae0b429f60b696 100644 |
--- a/fpdfsdk/src/javascript/global.cpp |
+++ b/fpdfsdk/src/javascript/global.cpp |
@@ -88,17 +88,12 @@ END_JS_STATIC_METHOD() |
IMPLEMENT_SPECIAL_JS_CLASS(CJS_Global, JSGlobalAlternate, global); |
-FX_BOOL CJS_Global::InitInstance(IJS_Context* cc) { |
- CJS_Context* pContext = (CJS_Context*)cc; |
- ASSERT(pContext != NULL); |
- |
- JSGlobalAlternate* pGlobal = (JSGlobalAlternate*)GetEmbedObject(); |
- ASSERT(pGlobal != NULL); |
- |
- pGlobal->Initial(pContext->GetReaderApp()); |
- |
- return TRUE; |
-}; |
+void CJS_Global::InitInstance(IJS_Runtime* pIRuntime) { |
+ CJS_Runtime* pRuntime = static_cast<CJS_Runtime*>(pIRuntime); |
+ JSGlobalAlternate* pGlobal = |
+ static_cast<JSGlobalAlternate*>(GetEmbedObject()); |
+ pGlobal->Initial(pRuntime->GetReaderApp()); |
+} |
JSGlobalAlternate::JSGlobalAlternate(CJS_Object* pJSObject) |
: CJS_EmbedObj(pJSObject), m_pApp(NULL) { |