From 1dddfeccb2339e1ea04701ea0d398b868c0784be 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 47d7d6194e6a9d..741f568259a1a6 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -254,7 +254,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