From 332032cc52523ebe691ff70a99b986b6f878c32b 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 0155123e831..8b55146dbe5 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -273,8 +273,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, @@ -287,8 +285,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);