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 18, 2017
1 parent b56ee01 commit 28adc36
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/bootstrap_node.js
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 28adc36

Please sign in to comment.