Skip to content

Commit 8d713d8

Browse files
mscdexrvagg
authored andcommitted
benchmark: allow empty parameters
PR-URL: #5123 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8301773 commit 8d713d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

benchmark/common.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ function parseOpts(options) {
188188
var num = keys.length;
189189
var conf = {};
190190
for (var i = 2; i < process.argv.length; i++) {
191-
var match = process.argv[i].match(/^(.+)=(.+)$/);
192-
if (!match || !match[1] || !match[2] || !options[match[1]]) {
191+
var match = process.argv[i].match(/^(.+)=(.*)$/);
192+
if (!match || !match[1] || !options[match[1]]) {
193193
return null;
194194
} else {
195-
conf[match[1]] = isFinite(match[2]) ? +match[2] : match[2]
195+
conf[match[1]] = (match[2].length && isFinite(match[2])
196+
? +match[2]
197+
: match[2]);
196198
num--;
197199
}
198200
}

0 commit comments

Comments
 (0)