Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Prefer --inspect-brk over --debug-brk #43

Merged
merged 1 commit into from
Apr 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/_inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
return portIsFree(inspectHost, inspectPort)
.then(() => {
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');
Expand Down