aboutsummaryrefslogtreecommitdiff
path: root/deps/node-inspect
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2017-04-06 10:40:55 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2017-04-11 17:58:26 -0700
commitb7608ac7077f95837c3b9eefdfd04c45b66179fa (patch)
treed3093b585428a07cfe305be2e824197f481ebdbd /deps/node-inspect
parenta91242569ab9e1ee80832ce982e07975c3e047a6 (diff)
downloadandroid-node-v8-b7608ac7077f95837c3b9eefdfd04c45b66179fa.tar.gz
android-node-v8-b7608ac7077f95837c3b9eefdfd04c45b66179fa.tar.bz2
android-node-v8-b7608ac7077f95837c3b9eefdfd04c45b66179fa.zip
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/node-inspect')
-rw-r--r--deps/node-inspect/lib/_inspect.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/deps/node-inspect/lib/_inspect.js b/deps/node-inspect/lib/_inspect.js
index ac32e0a6a4..7c13ef786e 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');