diff options
author | Jesse Jackson <jsejcksn@users.noreply.github.com> | 2020-10-19 21:43:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 13:43:29 +1100 |
commit | 992c2a436e5fe371807dd43bd293bb811fd529e7 (patch) | |
tree | 37468963d914fd41c7ac1609deb906da414a0db0 /cli/rt/40_performance.js | |
parent | 4ff5003eb6cc929db9986a999c4366f5337a27f7 (diff) |
fix(cli/rt/performance): check for object props in startOrMeasureOptions before throwing (#7884)
Fixes #7876
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/rt/40_performance.js')
-rw-r--r-- | cli/rt/40_performance.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/rt/40_performance.js b/cli/rt/40_performance.js index b921ca43a..573fc8051 100644 --- a/cli/rt/40_performance.js +++ b/cli/rt/40_performance.js @@ -249,7 +249,10 @@ startOrMeasureOptions = {}, endMark, ) { - if (startOrMeasureOptions && typeof startOrMeasureOptions === "object") { + if ( + startOrMeasureOptions && typeof startOrMeasureOptions === "object" && + Object.keys(startOrMeasureOptions).length > 0 + ) { if (endMark) { throw new TypeError("Options cannot be passed with endMark."); } |