mirror of https://github.com/nodejs/node.git
benchmark: allow empty parameters
PR-URL: https://github.com/nodejs/node/pull/5123 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>pull/5123/merge
parent
4e4b260b07
commit
72d0f88215
|
@ -188,11 +188,13 @@ function parseOpts(options) {
|
|||
var num = keys.length;
|
||||
var conf = {};
|
||||
for (var i = 2; i < process.argv.length; i++) {
|
||||
var match = process.argv[i].match(/^(.+)=(.+)$/);
|
||||
if (!match || !match[1] || !match[2] || !options[match[1]]) {
|
||||
var match = process.argv[i].match(/^(.+)=(.*)$/);
|
||||
if (!match || !match[1] || !options[match[1]]) {
|
||||
return null;
|
||||
} else {
|
||||
conf[match[1]] = isFinite(match[2]) ? +match[2] : match[2]
|
||||
conf[match[1]] = (match[2].length && isFinite(match[2])
|
||||
? +match[2]
|
||||
: match[2]);
|
||||
num--;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue