Skip to content

Commit

Permalink
inspector: always set process.binding('inspector').callAndPauseOnStart
Browse files Browse the repository at this point in the history
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: #26793
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
joyeecheung authored and targos committed Mar 27, 2019
1 parent d80cd50 commit 3574b62
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/inspector_js_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ void Initialize(Local<Object> target, Local<Value> unused,
Local<Context> context, void* priv) {
Environment* env = Environment::GetCurrent(context);

Agent* agent = env->inspector_agent();

v8::Local<v8::Function> consoleCallFunc =
env->NewFunctionTemplate(InspectorConsoleCall, v8::Local<v8::Signature>(),
v8::ConstructorBehavior::kThrow,
Expand All @@ -285,8 +283,7 @@ void Initialize(Local<Object> target, Local<Value> 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);

Expand Down

0 comments on commit 3574b62

Please sign in to comment.