lib: refactor bootstrap_node.js regular expression

* use `+` instead of `*` where one-or-more is required
* switch from String.prototype.match() to RegExp.prototype.test()

PR-URL: https://github.com/nodejs/node/pull/10749
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
This commit is contained in:
Rich Trott authored and Italo A. Casas committed 2017-01-27 08:12:00 -05:00
1 parent 06acf88117
commit 4de7b03a7d
1 file changed
+1 -3
+1 -3
View File
@@ -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) {