summaryrefslogtreecommitdiff
path: root/fxjs/cjs_document.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-02-07 21:07:24 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-07 21:07:24 +0000
commit9ad9a5fc81a36ab406ff49408dd0814d350bbc7e (patch)
treeec46a8cbec08c17d5932bd330c4fd4b5baa2c180 /fxjs/cjs_document.cpp
parent161f992a81e400eeebba49387f174d836750d624 (diff)
downloadpdfium-9ad9a5fc81a36ab406ff49408dd0814d350bbc7e.tar.xz
Split creation of ordinary object and bound objects in FXJS.chromium/3343
One can be performed by the CJS_V8 layer, the other requires the full FXJS mechanism. Avoids using -1 as a special case. Change-Id: I4a14ccb6a7fea393f84b70a07ada03b1a83c7d36 Reviewed-on: https://pdfium-review.googlesource.com/25830 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_document.cpp')
-rw-r--r--fxjs/cjs_document.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index c4a5ff4091..83711e1b28 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -254,7 +254,7 @@ CJS_Return CJS_Document::getField(
return CJS_Return(pRuntime->NewUndefined());
v8::Local<v8::Object> pFieldObj =
- pRuntime->NewFxDynamicObj(CJS_Field::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_Field::GetObjDefnID());
if (pFieldObj.IsEmpty())
return CJS_Return(false);
@@ -672,7 +672,7 @@ CJS_Return CJS_Document::get_info(CJS_Runtime* pRuntime) {
WideString cwModDate = pDictionary->GetUnicodeTextFor("ModDate");
WideString cwTrapped = pDictionary->GetUnicodeTextFor("Trapped");
- v8::Local<v8::Object> pObj = pRuntime->NewFxDynamicObj(-1);
+ v8::Local<v8::Object> pObj = pRuntime->NewObject();
pRuntime->PutObjectProperty(pObj, L"Author",
pRuntime->NewString(cwAuthor.AsStringView()));
pRuntime->PutObjectProperty(pObj, L"Title",
@@ -1031,7 +1031,7 @@ CJS_Return CJS_Document::getAnnot(
return CJS_Return(false);
v8::Local<v8::Object> pObj =
- pRuntime->NewFxDynamicObj(CJS_Annot::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_Annot::GetObjDefnID());
if (pObj.IsEmpty())
return CJS_Return(false);
@@ -1066,7 +1066,7 @@ CJS_Return CJS_Document::getAnnots(
return CJS_Return(JSGetStringFromID(JSMessage::kBadObjectError));
v8::Local<v8::Object> pObj =
- pRuntime->NewFxDynamicObj(CJS_Annot::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_Annot::GetObjDefnID());
if (pObj.IsEmpty())
return CJS_Return(false);
@@ -1143,7 +1143,7 @@ CJS_Return CJS_Document::get_icons(CJS_Runtime* pRuntime) {
int i = 0;
for (const auto& name : m_IconNames) {
v8::Local<v8::Object> pObj =
- pRuntime->NewFxDynamicObj(CJS_Icon::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_Icon::GetObjDefnID());
if (pObj.IsEmpty())
return CJS_Return(false);
@@ -1175,7 +1175,7 @@ CJS_Return CJS_Document::getIcon(
return CJS_Return(false);
v8::Local<v8::Object> pObj =
- pRuntime->NewFxDynamicObj(CJS_Icon::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_Icon::GetObjDefnID());
if (pObj.IsEmpty())
return CJS_Return(false);
@@ -1325,7 +1325,7 @@ CJS_Return CJS_Document::getPrintParams(
CJS_Runtime* pRuntime,
const std::vector<v8::Local<v8::Value>>& params) {
v8::Local<v8::Object> pRetObj =
- pRuntime->NewFxDynamicObj(CJS_PrintParamsObj::GetObjDefnID());
+ pRuntime->NewFXJSBoundObject(CJS_PrintParamsObj::GetObjDefnID());
if (pRetObj.IsEmpty())
return CJS_Return(false);