From b88e848c6f30bfed07c935b4d892bc7d7e52db7b 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 fc8aa451347..f2f14f281bc 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -252,7 +252,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