diff options
author | Brian White <mscdex@mscdex.net> | 2016-02-05 22:20:00 -0500 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-02-09 20:35:19 -0800 |
commit | 72d0f8821530bc77a369914c285a45991b2bf465 (patch) | |
tree | 16eeac2d982420a28fc7248840a7a8964376ec95 /benchmark | |
parent | 4e4b260b07dc2519aa5333b82e8f8a4aac861027 (diff) | |
download | android-node-v8-72d0f8821530bc77a369914c285a45991b2bf465.tar.gz android-node-v8-72d0f8821530bc77a369914c285a45991b2bf465.tar.bz2 android-node-v8-72d0f8821530bc77a369914c285a45991b2bf465.zip |
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>
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/common.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/benchmark/common.js b/benchmark/common.js index 511ae384f4..c0c7805a5c 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--; } } |