From a81e1669362732aec0e31fe63b129ff0466bb465 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 20 Mar 2019 09:21:38 +0800 Subject: [PATCH] inspector: always set process.binding('inspector').callAndPauseOnStart Since `process.binding('inspector')` is loaded during bootstrap, simply set `process.binding('inspector').callAndPauseOnStart` unconditionally instead of relying on `agent->WillWaitForConnect()` which depends on runtime states, PR-URL: https://github.com/nodejs/node/pull/26793 Reviewed-By: Eugene Ostroukhov Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- src/inspector_js_api.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index 58e7fb495c1f9f..48a89cb2d7de1f 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -271,8 +271,6 @@ void Initialize(Local target, Local unused, Local context, void* priv) { Environment* env = Environment::GetCurrent(context); - Agent* agent = env->inspector_agent(); - v8::Local consoleCallFunc = env->NewFunctionTemplate(InspectorConsoleCall, v8::Local(), v8::ConstructorBehavior::kThrow, @@ -285,8 +283,7 @@ void Initialize(Local target, Local unused, env->SetMethod( target, "setConsoleExtensionInstaller", SetConsoleExtensionInstaller); - if (agent->WillWaitForConnect()) - env->SetMethod(target, "callAndPauseOnStart", CallAndPauseOnStart); + env->SetMethod(target, "callAndPauseOnStart", CallAndPauseOnStart); env->SetMethod(target, "open", Open); env->SetMethodNoSideEffect(target, "url", Url);