summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 2daa62608b..a17b8e23a5 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -84,34 +84,34 @@ void CJS_Runtime::DefineJSObjects() {
// The call order determines the "ObjDefID" assigned to each class.
// ObjDefIDs 0 - 2
- CJS_Border::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Display::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Font::DefineJSObjects(GetIsolate(), FXJS_STATIC);
+ CJS_Border::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Display::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Font::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
// ObjDefIDs 3 - 5
- CJS_Highlight::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Position::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_ScaleHow::DefineJSObjects(GetIsolate(), FXJS_STATIC);
+ CJS_Highlight::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Position::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_ScaleHow::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
// ObjDefIDs 6 - 8
- CJS_ScaleWhen::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Style::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Zoomtype::DefineJSObjects(GetIsolate(), FXJS_STATIC);
+ CJS_ScaleWhen::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Style::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Zoomtype::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
// ObjDefIDs 9 - 11
- CJS_App::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Color::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Console::DefineJSObjects(GetIsolate(), FXJS_STATIC);
+ CJS_App::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Color::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Console::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
// ObjDefIDs 12 - 14
- CJS_Document::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
- CJS_Event::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Field::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
+ CJS_Document::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_GLOBAL);
+ CJS_Event::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Field::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC);
// ObjDefIDs 15 - 17
- CJS_Global::DefineJSObjects(GetIsolate(), FXJS_STATIC);
- CJS_Icon::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
- CJS_Util::DefineJSObjects(GetIsolate(), FXJS_STATIC);
+ CJS_Global::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
+ CJS_Icon::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC);
+ CJS_Util::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_STATIC);
// ObjDefIDs 18 - 20 (these can't fail, return void).
CJS_PublicMethods::DefineJSObjects(GetIsolate());
@@ -119,8 +119,8 @@ void CJS_Runtime::DefineJSObjects() {
CJS_GlobalArrays::DefineJSObjects(GetIsolate());
// ObjDefIDs 21 - 22.
- CJS_TimerObj::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
- CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), FXJS_DYNAMIC);
+ CJS_TimerObj::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC);
+ CJS_PrintParamsObj::DefineJSObjects(GetIsolate(), FXJSOBJTYPE_DYNAMIC);
}
IFXJS_Context* CJS_Runtime::NewContext() {
@@ -159,8 +159,7 @@ void CJS_Runtime::SetReaderDocument(CPDFSDK_Document* pReaderDoc) {
if (pReaderDoc) {
v8::Local<v8::Object> pThis = FXJS_GetThisObj(GetIsolate());
if (!pThis.IsEmpty()) {
- if (FXJS_GetObjDefnID(pThis) ==
- FXJS_GetObjDefnID(GetIsolate(), L"Document")) {
+ if (FXJS_GetObjDefnID(pThis) == CJS_Document::g_nObjDefnID) {
if (CJS_Document* pJSDocument =
(CJS_Document*)FXJS_GetPrivate(GetIsolate(), pThis)) {
if (Document* pDocument = (Document*)pJSDocument->GetEmbedObject())