Browse Source

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>
v6
Rich Trott 8 years ago
committed by James M Snell
parent
commit
20efbffaf8
  1. 4
      lib/internal/bootstrap_node.js

4
lib/internal/bootstrap_node.js

@ -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) {

Loading…
Cancel
Save