Skip to content

Commit 0ed27d2

Browse files
committed
make flag override more consistent
1 parent c08704f commit 0ed27d2

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

JetStreamDriver.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,18 @@ function getTestListParam(urlParams, key) {
6161
if (typeof(URLSearchParams) !== "undefined") {
6262
const urlParameters = new URLSearchParams(window.location.search);
6363
shouldReport = urlParameters.has('report') && urlParameters.get('report').toLowerCase() == 'true';
64-
globalThis.startDelay = getIntParam(urlParameters, "startDelay");
64+
if (urlParameters.has("startDelay"))
65+
globalThis.startDelay = getIntParam(urlParameters, "startDelay");
6566
if (shouldReport && !globalThis.startDelay)
6667
globalThis.startDelay = 4000;
6768
if (urlParameters.has("tag"))
6869
globalThis.testList = getTestListParam(urlParameters, "tag");
6970
if (urlParameters.has("test"))
7071
globalThis.testList = getTestListParam(urlParameters, "test");
71-
globalThis.testIterationCount = getIntParam(urlParameters, "iterationCount");
72-
globalThis.testWorstCaseCount = getIntParam(urlParameters, "worstCaseCount");
72+
if (urlParameters.has("iterationCount"))
73+
globalThis.testIterationCount = getIntParam(urlParameters, "iterationCount");
74+
if (urlParameters.has("worstCaseCount"))
75+
globalThis.testWorstCaseCount = getIntParam(urlParameters, "worstCaseCount");
7376
}
7477

7578
// Used for the promise representing the current benchmark run.

cli.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,16 @@ function getIntFlag(flags, flag) {
4646
return value;
4747
}
4848

49-
globalThis.testIterationCount = getIntFlag(cliFlags, "--iteration-count");
50-
globalThis.testWorstCaseCount = getIntFlag(cliFlags, "--worst-case-count");
51-
49+
if ("--iteration-count" in cliFlags)
50+
globalThis.testIterationCount = getIntFlag(cliFlags, "--iteration-count");
51+
if ("--worst-case-count" in cliFlags)
52+
globalThis.testWorstCaseCount = getIntFlag(cliFlags, "--worst-case-count");
5253
if ("--dump-json-results" in cliFlags)
5354
globalThis.dumpJSONResults = true;
54-
5555
if (typeof runMode !== "undefined" && runMode == "RAMification")
5656
globalThis.RAMification = true;
5757
if ("--ramification" in cliFlags)
5858
globalThis.RAMification = true;
59-
6059
if (cliArgs.length)
6160
globalThis.testList = cliArgs;
6261

0 commit comments

Comments
 (0)