diff --git a/src/debug-agent.cc b/src/debug-agent.cc index e46bd71b0536ca..5fcc7ebb2ecc23 100644 --- a/src/debug-agent.cc +++ b/src/debug-agent.cc @@ -124,7 +124,8 @@ void Agent::Enable() { // Assign environment to the debugger's context // NOTE: The debugger context is created after `SetMessageHandler()` call - parent_env()->AssignToContext(v8::Debug::GetDebugContext()); + auto debug_context = v8::Debug::GetDebugContext(parent_env()->isolate()); + parent_env()->AssignToContext(debug_context); } diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 1421528ff61d9a..3e643dfd1d384c 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -243,12 +243,12 @@ class ContextifyContext { Local script_source(args[0]->ToString(args.GetIsolate())); if (script_source.IsEmpty()) return; // Exception pending. - Local debug_context = Debug::GetDebugContext(); + Local debug_context = Debug::GetDebugContext(args.GetIsolate()); Environment* env = Environment::GetCurrent(args); if (debug_context.IsEmpty()) { // Force-load the debug context. Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); - debug_context = Debug::GetDebugContext(); + debug_context = Debug::GetDebugContext(args.GetIsolate()); CHECK(!debug_context.IsEmpty()); // Ensure that the debug context has an Environment assigned in case // a fatal error is raised. The fatal exception handler in node.cc