summaryrefslogtreecommitdiff
path: root/fxjse
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 /fxjse
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 'fxjse')
-rw-r--r--fxjse/context.cpp4
-rw-r--r--fxjse/runtime.cpp8
2 files changed, 11 insertions, 1 deletions
diff --git a/fxjse/context.cpp b/fxjse/context.cpp
index 3ecc3e2321..9c43830997 100644
--- a/fxjse/context.cpp
+++ b/fxjse/context.cpp
@@ -141,6 +141,10 @@ CFXJSE_Context* CFXJSE_Context::Create(
hObjectTemplate = v8::ObjectTemplate::New(pIsolate);
hObjectTemplate->SetInternalFieldCount(1);
}
+ hObjectTemplate->Set(
+ v8::Symbol::GetToStringTag(pIsolate),
+ v8::String::NewFromUtf8(pIsolate, "global", v8::NewStringType::kNormal)
+ .ToLocalChecked());
v8::Local<v8::Context> hNewContext =
v8::Context::New(pIsolate, NULL, hObjectTemplate);
v8::Local<v8::Context> hRootContext = v8::Local<v8::Context>::New(
diff --git a/fxjse/runtime.cpp b/fxjse/runtime.cpp
index 29814bdc7e..b5f2f33a75 100644
--- a/fxjse/runtime.cpp
+++ b/fxjse/runtime.cpp
@@ -79,8 +79,14 @@ CFXJSE_RuntimeData* CFXJSE_RuntimeData::Create(v8::Isolate* pIsolate) {
CFXJSE_ScopeUtil_IsolateHandle scope(pIsolate);
v8::Local<v8::FunctionTemplate> hFuncTemplate =
v8::FunctionTemplate::New(pIsolate);
+ v8::Local<v8::ObjectTemplate> hGlobalTemplate =
+ hFuncTemplate->InstanceTemplate();
+ hGlobalTemplate->Set(
+ v8::Symbol::GetToStringTag(pIsolate),
+ v8::String::NewFromUtf8(pIsolate, "global", v8::NewStringType::kNormal)
+ .ToLocalChecked());
v8::Local<v8::Context> hContext =
- v8::Context::New(pIsolate, 0, hFuncTemplate->InstanceTemplate());
+ v8::Context::New(pIsolate, 0, hGlobalTemplate);
hContext->SetSecurityToken(v8::External::New(pIsolate, pIsolate));
pRuntimeData->m_hRootContextGlobalTemplate.Reset(pIsolate, hFuncTemplate);
pRuntimeData->m_hRootContext.Reset(pIsolate, hContext);