Skip to content

Commit ee1056d

Browse files
targosdanielleadams
authored andcommitted
debugger: wait for V8 debugger to be enabled
Refs: #38273 (comment) PR-URL: #38811 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 3c492ba commit ee1056d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/internal/inspector/_inspect.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ class NodeInspector {
199199
process.once('SIGTERM', exitCodeZero);
200200
process.once('SIGHUP', exitCodeZero);
201201

202-
PromisePrototypeCatch(PromisePrototypeThen(this.run(), () => {
203-
const repl = startRepl();
202+
PromisePrototypeCatch(PromisePrototypeThen(this.run(), async () => {
203+
const repl = await startRepl();
204204
this.repl = repl;
205205
this.repl.on('exit', exitCodeZero);
206206
this.paused = false;

lib/internal/inspector/inspect_repl.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1146,14 +1146,17 @@ function createRepl(inspector) {
11461146
return Runtime.runIfWaitingForDebugger();
11471147
}
11481148

1149-
return function startRepl() {
1149+
return async function startRepl() {
11501150
inspector.client.on('close', () => {
11511151
resetOnStart();
11521152
});
11531153
inspector.client.on('ready', () => {
11541154
initAfterStart();
11551155
});
11561156

1157+
// Init once for the initial connection
1158+
await initAfterStart();
1159+
11571160
const replOptions = {
11581161
prompt: 'debug> ',
11591162
input: inspector.stdin,
@@ -1172,9 +1175,6 @@ function createRepl(inspector) {
11721175
repl.emit('SIGINT');
11731176
});
11741177

1175-
// Init once for the initial connection
1176-
initAfterStart();
1177-
11781178
return repl;
11791179
};
11801180
}

0 commit comments

Comments
 (0)