From 917279b35d55dc3ba7be396b1854c6fcb97bd43c Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Tue, 17 Mar 2026 17:41:54 +0100 Subject: [PATCH] Fix --test for d8 shell runner There seems to be two bugs when running `d8 cli.js -- --test `: 1. A typo in cli.js (`cliParams.get("tests")` should've been `cliParams.get("test")`) which leads to ``` cli.js:122: TypeError: Cannot read properties of undefined (reading 'split') let tests = cliParams.has("test") ? cliParams.get("tests").split(",") : [] ^ TypeError: Cannot read properties of undefined (reading 'split') at cli.js:122:63 ``` 2. performance.mark/performance.measure in d8 requires PerformanceMark objects as arguments and do not take mark name strings. ``` console.error: JetStream3 failed: Error: Invalid 'startMark' argument: Not an Object console.error: Error: Invalid 'startMark' argument: Not an Object at Driver.start (./JetStreamDriver.js:352:25) at async runJetStream (cli.js:135:9) cli.js:141: Error: Invalid 'startMark' argument: Not an Object ``` This patch fixes the typo in 1. For 2, since these are only used for UI annotations, replace them with no-ops in d8 instead. --- cli.js | 2 +- utils/shell-config.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli.js b/cli.js index e05211da..cd1dd423 100644 --- a/cli.js +++ b/cli.js @@ -119,7 +119,7 @@ const printHelp = cliParams.delete("help"); const dumpTestList = cliParams.delete("dumpTestList"); if (cliArgs.length) { - let tests = cliParams.has("test") ? cliParams.get("tests").split(",") : [] + let tests = cliParams.has("test") ? cliParams.get("test").split(",") : [] tests = tests.concat(cliArgs); cliParams.set("test", tests.join(",")); } diff --git a/utils/shell-config.js b/utils/shell-config.js index 59d7895c..dfcc4647 100644 --- a/utils/shell-config.js +++ b/utils/shell-config.js @@ -55,3 +55,8 @@ if (typeof performance == "undefined") performance.mark ??= function(){}; performance.measure ??= function(){}; + +if (isD8) { + performance.mark = function(){}; + performance.measure = function(){}; +}