diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2017-04-06 20:40:55 +0300 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2017-04-12 03:58:26 +0300 |
commit | b7608ac7077f95837c3b9eefdfd04c45b66179fa (patch) | |
tree | d3093b585428a07cfe305be2e824197f481ebdbd /deps | |
parent | a91242569ab9e1ee80832ce982e07975c3e047a6 (diff) |
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>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/node-inspect/lib/_inspect.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/node-inspect/lib/_inspect.js b/deps/node-inspect/lib/_inspect.js index ac32e0a6a43..7c13ef786e3 100644 --- a/deps/node-inspect/lib/_inspect.js +++ b/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'); |