From 8d713d8d511734bc9859488ab53fe44a85f887db Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 5 Feb 2016 22:20:00 -0500 Subject: [PATCH] benchmark: allow empty parameters PR-URL: https://github.com/nodejs/node/pull/5123 Reviewed-By: Roman Reiss Reviewed-By: James M Snell --- benchmark/common.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmark/common.js b/benchmark/common.js index 511ae384f418bf..c0c7805a5c53db 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -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--; } }