Skip to content

Commit b7608ac

Browse files
committed
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 <[email protected]> Reviewed-By: joshgav - Josh Gavant <[email protected]> Reviewed-By: cjihrig - Colin Ihrig <[email protected]> Reviewed-By: targos - Michaël Zasso <[email protected]>
1 parent a912425 commit b7608ac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

deps/node-inspect/lib/_inspect.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ function getDefaultPort() {
5555

5656
function runScript(script, scriptArgs, inspectPort, childPrint) {
5757
return new Promise((resolve) => {
58-
const args = [
59-
'--inspect',
60-
`--debug-brk=${inspectPort}`,
61-
].concat([script], scriptArgs);
58+
const needDebugBrk = process.version.match(/^v(6|7)\./);
59+
const args = (needDebugBrk ?
60+
['--inspect', `--debug-brk=${inspectPort}`] :
61+
[`--inspect-brk=${inspectPort}`])
62+
.concat([script], scriptArgs);
6263
const child = spawn(process.execPath, args);
6364
child.stdout.setEncoding('utf8');
6465
child.stderr.setEncoding('utf8');

0 commit comments

Comments
 (0)