mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
debugger: wait for V8 debugger to be enabled
Refs: https://github.com/nodejs/node/pull/38273#issuecomment-848438189 PR-URL: https://github.com/nodejs/node/pull/38811 Backport-PR-URL: https://github.com/nodejs/node/pull/39446 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
721edeffd3
commit
79bfb0416b
|
|
@ -203,8 +203,8 @@ class NodeInspector {
|
|||
process.once('SIGTERM', exitCodeZero);
|
||||
process.once('SIGHUP', exitCodeZero);
|
||||
|
||||
PromisePrototypeCatch(PromisePrototypeThen(this.run(), () => {
|
||||
const repl = startRepl();
|
||||
PromisePrototypeCatch(PromisePrototypeThen(this.run(), async () => {
|
||||
const repl = await startRepl();
|
||||
this.repl = repl;
|
||||
this.repl.on('exit', exitCodeZero);
|
||||
this.paused = false;
|
||||
|
|
|
|||
|
|
@ -1077,7 +1077,7 @@ function createRepl(inspector) {
|
|||
.then(() => Runtime.runIfWaitingForDebugger());
|
||||
}
|
||||
|
||||
return function startRepl() {
|
||||
return async function startRepl() {
|
||||
inspector.client.on('close', () => {
|
||||
resetOnStart();
|
||||
});
|
||||
|
|
@ -1085,6 +1085,9 @@ function createRepl(inspector) {
|
|||
initAfterStart();
|
||||
});
|
||||
|
||||
// Init once for the initial connection
|
||||
await initAfterStart();
|
||||
|
||||
const replOptions = {
|
||||
prompt: 'debug> ',
|
||||
input: inspector.stdin,
|
||||
|
|
@ -1103,9 +1106,6 @@ function createRepl(inspector) {
|
|||
repl.emit('SIGINT');
|
||||
});
|
||||
|
||||
// Init once for the initial connection
|
||||
initAfterStart();
|
||||
|
||||
return repl;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user