Skip to content

Commit 8bccd9e

Browse files
lanceMylesBorins
authored andcommitted
debugger: call this.resume() after this.run()
When the debugger has started we need to call `this.resume` otherwise, the prompt won't appear. Fixes: #9854 PR-URL: #10099 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent d532d74 commit 8bccd9e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/_debugger.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ function Interface(stdin, stdout, args) {
839839
// Run script automatically
840840
this.pause();
841841

842-
setImmediate(() => { this.run(); });
842+
setImmediate(() => { this.run(() => this.resume()); });
843843
}
844844

845845

test/parallel/test-debug-prompt.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
const assert = require('assert');
4+
const common = require('../common');
5+
const spawn = require('child_process').spawn;
6+
7+
const proc = spawn(process.execPath, ['debug', 'foo']);
8+
proc.stdout.setEncoding('utf8');
9+
10+
proc.stdout.once('data', common.mustCall((data) => {
11+
assert.strictEqual(data, 'debug> ');
12+
proc.kill();
13+
}));

0 commit comments

Comments
 (0)