From 992c2a436e5fe371807dd43bd293bb811fd529e7 Mon Sep 17 00:00:00 2001 From: Jesse Jackson Date: Mon, 19 Oct 2020 21:43:29 -0500 Subject: fix(cli/rt/performance): check for object props in startOrMeasureOptions before throwing (#7884) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #7876 Co-authored-by: Ryan Dahl Co-authored-by: Bartek IwaƄczuk --- cli/rt/40_performance.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cli/rt') 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."); } -- cgit v1.2.3