From 80d23426f170aaafc90e6fe06b45a1a4c86f6e9e Mon Sep 17 00:00:00 2001 From: Yang Guo Date: Thu, 2 Feb 2017 09:02:46 +0100 Subject: [PATCH] contextify: remove usage of deprecated debug API. Debug::GetMirror is used here to force loading of the debug context. There is a better way to achieve this. --- src/node_contextify.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index d74b01ea0da371..8e4114170dd4d5 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -244,6 +244,9 @@ class ContextifyContext { } + static void DummyDebugEventListener(const Debug::EventDetails&) {} + + static void RunInDebugContext(const FunctionCallbackInfo& args) { Local script_source(args[0]->ToString(args.GetIsolate())); if (script_source.IsEmpty()) @@ -252,7 +255,7 @@ class ContextifyContext { Environment* env = Environment::GetCurrent(args); if (debug_context.IsEmpty()) { // Force-load the debug context. - Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); + Debug::SetDebugEventListener(args.GetIsolate(), DummyDebugEventListener); debug_context = Debug::GetDebugContext(args.GetIsolate()); CHECK(!debug_context.IsEmpty()); // Ensure that the debug context has an Environment assigned in case