Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d8b902f

Browse filesBrowse 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 <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent bf882fb commit d8b902f
Copy full SHA for d8b902f

File tree

Expand file treeCollapse file tree

2 files changed

+14
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-1
lines changed
Open diff view settings
Collapse file

‎lib/_debugger.js‎

Copy file name to clipboardExpand all lines: lib/_debugger.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ function Interface(stdin, stdout, args) {
835835
// Run script automatically
836836
this.pause();
837837

838-
setImmediate(() => { this.run(); });
838+
setImmediate(() => { this.run(() => this.resume()); });
839839
}
840840

841841

Collapse file

‎test/parallel/test-debug-prompt.js‎

Copy file name to clipboard
+13Lines changed: 13 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.