Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-01-12 03:30:40 +0300
committerJames M Snell <jasnell@gmail.com>2017-01-13 21:10:21 +0300
commit20efbffaf8c5f4af94da31c95ba90e77a2e00e08 (patch)
treeedcbd1bb21056f9da8b694e846bd27459078e001 /lib
parent4424e847d5e1e74c701fcba300cbe42480c53aee (diff)
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap_node.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index 4e1e2aa9018..71a6c529041 100644
--- a/lib/internal/bootstrap_node.js
+++ b/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) {