summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/app.cpp')
-rw-r--r--fpdfsdk/src/javascript/app.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index 4815e4729c..d81b226f96 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -122,13 +122,15 @@ FX_BOOL app::activeDocs(IFXJS_Context* cc,
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument()) {
CJS_Document* pJSDocument = NULL;
if (pDoc == pCurDoc) {
- JSFXObject pObj = JS_GetThisObj(*pRuntime);
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document"))
+ v8::Local<v8::Object> pObj = JS_GetThisObj(pRuntime->GetIsolate());
+ if (JS_GetObjDefnID(pObj) ==
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"))
pJSDocument =
(CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(), pObj);
} else {
- JSFXObject pObj = JS_NewFxDynamicObj(
- *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Document"));
+ v8::Local<v8::Object> pObj = JS_NewFxDynamicObj(
+ pRuntime->GetIsolate(), pContext,
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"Document"));
pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(), pObj);
ASSERT(pJSDocument != NULL);
}
@@ -274,7 +276,7 @@ FX_BOOL app::alert(IFXJS_Context* cc,
if (iSize == 1) {
if (params[0].GetType() == VT_object) {
- JSObject pObj = params[0].ToV8Object();
+ v8::Local<v8::Object> pObj = params[0].ToV8Object();
{
v8::Local<v8::Value> pValue =
JS_GetObjectElement(isolate, pObj, L"cMsg");
@@ -419,8 +421,9 @@ FX_BOOL app::setInterval(IFXJS_Context* cc,
// pTimer->SetStartTime(GetTickCount());
pTimer->SetJSTimer(dwInterval);
- JSFXObject pRetObj = JS_NewFxDynamicObj(
- *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
+ v8::Local<v8::Object> pRetObj =
+ JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj"));
CJS_TimerObj* pJS_TimerObj =
(CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(), pRetObj);
@@ -471,8 +474,9 @@ FX_BOOL app::setTimeOut(IFXJS_Context* cc,
pTimer->SetTimeOut(dwTimeOut);
pTimer->SetJSTimer(dwTimeOut);
- JSFXObject pRetObj = JS_NewFxDynamicObj(
- *pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
+ v8::Local<v8::Object> pRetObj =
+ JS_NewFxDynamicObj(pRuntime->GetIsolate(), pContext,
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj"));
CJS_TimerObj* pJS_TimerObj =
(CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(), pRetObj);
@@ -503,9 +507,10 @@ FX_BOOL app::clearTimeOut(IFXJS_Context* cc,
}
if (params[0].GetType() == VT_fxobject) {
- JSFXObject pObj = params[0].ToV8Object();
+ v8::Local<v8::Object> pObj = params[0].ToV8Object();
{
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj")) {
+ if (JS_GetObjDefnID(pObj) ==
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")) {
if (CJS_Object* pJSObj = params[0].ToCJSObject()) {
if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject()) {
if (CJS_Timer* pTimer = pTimerObj->GetTimer()) {
@@ -545,9 +550,10 @@ FX_BOOL app::clearInterval(IFXJS_Context* cc,
}
if (params[0].GetType() == VT_fxobject) {
- JSFXObject pObj = params[0].ToV8Object();
+ v8::Local<v8::Object> pObj = params[0].ToV8Object();
{
- if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj")) {
+ if (JS_GetObjDefnID(pObj) ==
+ JS_GetObjDefnID(pRuntime->GetIsolate(), L"TimerObj")) {
if (CJS_Object* pJSObj = params[0].ToCJSObject()) {
if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject()) {
if (CJS_Timer* pTimer = pTimerObj->GetTimer()) {
@@ -642,7 +648,7 @@ FX_BOOL app::mailMsg(IFXJS_Context* cc,
return FALSE;
if (params[0].GetType() == VT_object) {
- JSObject pObj = params[0].ToV8Object();
+ v8::Local<v8::Object> pObj = params[0].ToV8Object();
v8::Local<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"bUI");
bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool();
@@ -780,7 +786,7 @@ FX_BOOL app::response(IFXJS_Context* cc,
int iLength = params.size();
if (iLength > 0 && params[0].GetType() == VT_object) {
- JSObject pObj = params[0].ToV8Object();
+ v8::Local<v8::Object> pObj = params[0].ToV8Object();
v8::Local<v8::Value> pValue =
JS_GetObjectElement(isolate, pObj, L"cQuestion");
swQuestion =