Skip to content

Commit

Permalink
lib: refactor bootstrap_node.js regular expression
Browse files Browse the repository at this point in the history
* use `+` instead of `*` where one-or-more is required
* switch from String.prototype.match() to RegExp.prototype.test()

PR-URL: nodejs#10749
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
  • Loading branch information
Trott authored and italoacasas committed Jan 27, 2017
1 parent 06acf88 commit 4de7b03
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@
}

function isDebugBreak() {
return process.execArgv.some((arg) => {
return arg.match(/^--debug-brk(=[0-9]*)?$/);
});
return process.execArgv.some((arg) => /^--debug-brk(=[0-9]+)?$/.test(arg));
}

function run(entryFunction) {
Expand Down

0 comments on commit 4de7b03

Please sign in to comment.