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
Brian White 2016-02-05 22:20:00 -05:00 committed by James M Snell
parent 4e4b260b07
commit 72d0f88215
1 changed files with 5 additions and 3 deletions

View File

@ -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--;
}
}