Permalink
Browse files

deps: cherry-pick node-inspect#43

Node 8.x no longer has --debug-brk.

Ref: nodejs/node-inspect#43
PR-URL: #11441
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: joshgav - Josh Gavant <josh.gavant@outlook.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
  • Loading branch information...
ofrobots committed Apr 6, 2017
1 parent a912425 commit b7608ac7077f95837c3b9eefdfd04c45b66179fa
Showing with 5 additions and 4 deletions.
  1. +5 −4 deps/node-inspect/lib/_inspect.js
@@ -55,10 +55,11 @@ function getDefaultPort() {
function runScript(script, scriptArgs, inspectPort, childPrint) {
return new Promise((resolve) => {
const args = [
'--inspect',
`--debug-brk=${inspectPort}`,
].concat([script], scriptArgs);
const needDebugBrk = process.version.match(/^v(6|7)\./);
const args = (needDebugBrk ?
['--inspect', `--debug-brk=${inspectPort}`] :
[`--inspect-brk=${inspectPort}`])
.concat([script], scriptArgs);
const child = spawn(process.execPath, args);
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');

0 comments on commit b7608ac

Please sign in to comment.