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
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:
Michaël Zasso authored and Danielle Adams committed 2021-05-31 15:34:57 -04:00
1 parent 3c492baa51
commit ee1056da60
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -199,8 +199,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;
+4 -4
View File
@@ -1146,7 +1146,7 @@ function createRepl(inspector) {
return Runtime.runIfWaitingForDebugger();
}
return function startRepl() {
return async function startRepl() {
inspector.client.on('close', () => {
resetOnStart();
});
@@ -1154,6 +1154,9 @@ function createRepl(inspector) {
initAfterStart();
});
// Init once for the initial connection
await initAfterStart();
const replOptions = {
prompt: 'debug> ',
input: inspector.stdin,
@@ -1172,9 +1175,6 @@ function createRepl(inspector) {
repl.emit('SIGINT');
});
// Init once for the initial connection
initAfterStart();
return repl;
};
}