summaryrefslogtreecommitdiff
path: root/fpdfsdk/jsapi/fxjs_v8.cpp
diff options
context:
space:
mode:
authorjochen <jochen@chromium.org>2016-07-06 11:02:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-06 11:02:27 -0700
commit7e6a8484b05819268b4e7f0350cebfb704c6d18c (patch)
treed62fdccd645e936f4f25a69dc51365dd1fa0ab1e /fpdfsdk/jsapi/fxjs_v8.cpp
parenta27d49a3e9eafd7fd911a0a6039ce80284ccb463 (diff)
downloadpdfium-7e6a8484b05819268b4e7f0350cebfb704c6d18c.tar.xz
Roll DEPS for v8 to 820a23aa.
Also roll DEPS for ICU to ffa4b670 and add a needed GYP variable. BUG= R=thestig@chromium.org Review-Url: https://codereview.chromium.org/2127553004
Diffstat (limited to 'fpdfsdk/jsapi/fxjs_v8.cpp')
-rw-r--r--fpdfsdk/jsapi/fxjs_v8.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/fpdfsdk/jsapi/fxjs_v8.cpp b/fpdfsdk/jsapi/fxjs_v8.cpp
index 3297b4bd12..ddeb28f237 100644
--- a/fpdfsdk/jsapi/fxjs_v8.cpp
+++ b/fpdfsdk/jsapi/fxjs_v8.cpp
@@ -65,6 +65,12 @@ class CFXJS_ObjDefinition {
v8::Local<v8::FunctionTemplate> fun = v8::FunctionTemplate::New(isolate);
fun->InstanceTemplate()->SetInternalFieldCount(2);
+ if (eObjType == FXJSOBJTYPE_GLOBAL) {
+ fun->InstanceTemplate()->Set(
+ v8::Symbol::GetToStringTag(isolate),
+ v8::String::NewFromUtf8(isolate, "global", v8::NewStringType::kNormal)
+ .ToLocalChecked());
+ }
m_FunctionTemplate.Reset(isolate, fun);
v8::Local<v8::Signature> sig = v8::Signature::New(isolate, fun);
@@ -108,9 +114,14 @@ static v8::Local<v8::ObjectTemplate> GetGlobalObjectTemplate(
return pObjDef->GetInstanceTemplate();
}
if (!g_DefaultGlobalObjectTemplate) {
- g_DefaultGlobalObjectTemplate = new v8::Global<v8::ObjectTemplate>;
- g_DefaultGlobalObjectTemplate->Reset(pIsolate,
- v8::ObjectTemplate::New(pIsolate));
+ v8::Local<v8::ObjectTemplate> hGlobalTemplate =
+ v8::ObjectTemplate::New(pIsolate);
+ hGlobalTemplate->Set(
+ v8::Symbol::GetToStringTag(pIsolate),
+ v8::String::NewFromUtf8(pIsolate, "global", v8::NewStringType::kNormal)
+ .ToLocalChecked());
+ g_DefaultGlobalObjectTemplate =
+ new v8::Global<v8::ObjectTemplate>(pIsolate, hGlobalTemplate);
}
return g_DefaultGlobalObjectTemplate->Get(pIsolate);
}