summaryrefslogtreecommitdiff
path: root/fxjse/runtime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjse/runtime.cpp')
-rw-r--r--fxjse/runtime.cpp8
1 files changed, 7 insertions, 1 deletions
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);