Browse Source

src: replace usage of deprecated GetDebugContext

PR-URL: https://github.com/nodejs/node/pull/5159
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
process-exit-stdio-flushing
Michaël Zasso 9 years ago
committed by Ali Sheikh
parent
commit
d515a3f4b4
  1. 3
      src/debug-agent.cc
  2. 4
      src/node_contextify.cc

3
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);
}

4
src/node_contextify.cc

@ -243,12 +243,12 @@ class ContextifyContext {
Local<String> script_source(args[0]->ToString(args.GetIsolate()));
if (script_source.IsEmpty())
return; // Exception pending.
Local<Context> debug_context = Debug::GetDebugContext();
Local<Context> 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

Loading…
Cancel
Save