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 <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
83972ff6ac
commit
332032cc52
@ -273,8 +273,6 @@ void Initialize(Local<Object> target, Local<Value> unused,
|
|||||||
Local<Context> context, void* priv) {
|
Local<Context> context, void* priv) {
|
||||||
Environment* env = Environment::GetCurrent(context);
|
Environment* env = Environment::GetCurrent(context);
|
||||||
|
|
||||||
Agent* agent = env->inspector_agent();
|
|
||||||
|
|
||||||
v8::Local<v8::Function> consoleCallFunc =
|
v8::Local<v8::Function> consoleCallFunc =
|
||||||
env->NewFunctionTemplate(InspectorConsoleCall, v8::Local<v8::Signature>(),
|
env->NewFunctionTemplate(InspectorConsoleCall, v8::Local<v8::Signature>(),
|
||||||
v8::ConstructorBehavior::kThrow,
|
v8::ConstructorBehavior::kThrow,
|
||||||
@ -287,8 +285,7 @@ void Initialize(Local<Object> target, Local<Value> unused,
|
|||||||
|
|
||||||
env->SetMethod(
|
env->SetMethod(
|
||||||
target, "setConsoleExtensionInstaller", SetConsoleExtensionInstaller);
|
target, "setConsoleExtensionInstaller", SetConsoleExtensionInstaller);
|
||||||
if (agent->WillWaitForConnect())
|
env->SetMethod(target, "callAndPauseOnStart", CallAndPauseOnStart);
|
||||||
env->SetMethod(target, "callAndPauseOnStart", CallAndPauseOnStart);
|
|
||||||
env->SetMethod(target, "open", Open);
|
env->SetMethod(target, "open", Open);
|
||||||
env->SetMethodNoSideEffect(target, "url", Url);
|
env->SetMethodNoSideEffect(target, "url", Url);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user