Skip to content

Commit

Permalink
debugger: call this.resume() after this.run()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lance authored and Fishrock123 committed Dec 6, 2016
1 parent 2beba9e commit dfa35d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ function Interface(stdin, stdout, args) {
// Run script automatically
this.pause();

setImmediate(() => { this.run(); });
setImmediate(() => { this.run(() => this.resume()); });
}


Expand Down
13 changes: 13 additions & 0 deletions test/parallel/test-debug-prompt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const assert = require('assert');
const common = require('../common');
const spawn = require('child_process').spawn;

const proc = spawn(process.execPath, ['debug', 'foo']);
proc.stdout.setEncoding('utf8');

proc.stdout.once('data', common.mustCall((data) => {
assert.strictEqual(data, 'debug> ');
proc.kill();
}));

0 comments on commit dfa35d6

Please sign in to comment.