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 MylesBorins committed Jan 23, 2017
1 parent d32d64b commit 5c8881d
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 @@ -835,7 +835,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 5c8881d

Please sign in to comment.