From 539e83a8207d801c567a280e9ad1db136e34b46b Mon Sep 17 00:00:00 2001 From: Yang Guo Date: Thu, 2 Feb 2017 09:02:46 +0100 Subject: [PATCH] src: remove usage of deprecated debug API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Debug::GetMirror is used in contextify to force loading of the debug context. There is a better way to achieve this. PR-URL: https://github.com/nodejs/node/pull/11437 Reviewed-By: Anna Henningsen Reviewed-By: Evan Lucas Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Michaƫl Zasso --- src/node_contextify.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ff66ffdaaa0467..9b0ab4ea262d41 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -261,7 +261,8 @@ class ContextifyContext { Environment* env = Environment::GetCurrent(args); if (debug_context.IsEmpty()) { // Force-load the debug context. - Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); + auto dummy_event_listener = [] (const Debug::EventDetails&) {}; + Debug::SetDebugEventListener(args.GetIsolate(), dummy_event_listener); debug_context = Debug::GetDebugContext(args.GetIsolate()); CHECK(!debug_context.IsEmpty()); // Ensure that the debug context has an Environment assigned in case