Browse Source

deps: cherry-pick node-inspect#43

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

Ref: https://github.com/nodejs/node-inspect/pull/43
PR-URL: https://github.com/nodejs/node/pull/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>
v6
Ali Ijaz Sheikh 8 years ago
parent
commit
b7608ac707
  1. 9
      deps/node-inspect/lib/_inspect.js

9
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');

Loading…
Cancel
Save