Skip to content

Commit 917279b

Browse files
committed
Fix --test for d8 shell runner
There seems to be two bugs when running `d8 cli.js -- --test <subset>`: 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.
1 parent de88e36 commit 917279b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const printHelp = cliParams.delete("help");
119119
const dumpTestList = cliParams.delete("dumpTestList");
120120

121121
if (cliArgs.length) {
122-
let tests = cliParams.has("test") ? cliParams.get("tests").split(",") : []
122+
let tests = cliParams.has("test") ? cliParams.get("test").split(",") : []
123123
tests = tests.concat(cliArgs);
124124
cliParams.set("test", tests.join(","));
125125
}

utils/shell-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ if (typeof performance == "undefined")
5555

5656
performance.mark ??= function(){};
5757
performance.measure ??= function(){};
58+
59+
if (isD8) {
60+
performance.mark = function(){};
61+
performance.measure = function(){};
62+
}

0 commit comments

Comments
 (0)