Skip to content

Commit 1f6ad81

Browse files
committed
Always initialize preloads to an empty array.
1 parent 19b5b04 commit 1f6ad81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

JetStreamDriver.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ class Benchmark {
753753
this.isAsync = !!plan.isAsync;
754754
this.allowUtf16 = !!plan.allowUtf16;
755755
this.scripts = null;
756-
this.preloads = null;
756+
this.preloads = [];
757757
this.shellPrefetchedResources = null;
758758
this.results = [];
759759
this._state = BenchmarkState.READY;
@@ -1073,7 +1073,6 @@ class Benchmark {
10731073
}));
10741074

10751075
if (this.plan.preload) {
1076-
this.preloads = [];
10771076
for (const [name, resource] of Object.entries(this.plan.preload)) {
10781077
promises.push(this.loadBlob("preload", name, resource).then((blobData) => {
10791078
if (!globalThis.allIsGood)
@@ -1156,8 +1155,7 @@ class Benchmark {
11561155
console.assert(this.scripts === null, "This initialization should be called only once.");
11571156
this.scripts = this.plan.files.map(file => shellFileLoader.load(file));
11581157

1159-
console.assert(this.preloads === null, "This initialization should be called only once.");
1160-
this.preloads = [];
1158+
console.assert(this.preloads.length === 0, "This initialization should be called only once.");
11611159
this.shellPrefetchedResources = Object.create(null);
11621160
if (!this.plan.preload) {
11631161
return;

0 commit comments

Comments
 (0)