diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 2e8fd2cade6..15f87a2418e 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -257,7 +257,13 @@ class ContextifyContext { Local script_source(args[0]->ToString()); if (script_source.IsEmpty()) return; // Exception pending. - Context::Scope context_scope(Debug::GetDebugContext()); + + Environment* env = Environment::GetCurrent(args.GetIsolate()); + Local ctx = Debug::GetDebugContext(); + if (!ctx.IsEmpty()) + ctx->SetSecurityToken(env->context()->GetSecurityToken()); + + Context::Scope context_scope(ctx); Local