Browse Source

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>
process-exit-stdio-flushing
Brian White 9 years ago
committed by James M Snell
parent
commit
72d0f88215
  1. 8
      benchmark/common.js

8
benchmark/common.js

@ -188,11 +188,13 @@ function parseOpts(options) {
var num = keys.length; var num = keys.length;
var conf = {}; var conf = {};
for (var i = 2; i < process.argv.length; i++) { for (var i = 2; i < process.argv.length; i++) {
var match = process.argv[i].match(/^(.+)=(.+)$/); var match = process.argv[i].match(/^(.+)=(.*)$/);
if (!match || !match[1] || !match[2] || !options[match[1]]) { if (!match || !match[1] || !options[match[1]]) {
return null; return null;
} else { } 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--; num--;
} }
} }

Loading…
Cancel
Save