Skip to content

Commit f89f472

Browse files
committed
format
1 parent 59ffb07 commit f89f472

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

prismjs/benchmark.js

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
/*
2-
* Copyright (C) 2025 Apple Inc. All rights reserved.
3-
*
4-
* Redistribution and use in source and binary forms, with or without
5-
* modification, are permitted provided that the following conditions
6-
* are met:
7-
* 1. Redistributions of source code must retain the above copyright
8-
* notice, this list of conditions and the following disclaimer.
9-
* 2. Redistributions in binary form must reproduce the above copyright
10-
* notice, this list of conditions and the following disclaimer in the
11-
* documentation and/or other materials provided with the distribution.
12-
*
13-
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16-
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17-
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18-
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19-
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20-
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21-
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24-
*/
2+
* Copyright (C) 2025 Apple Inc. All rights reserved.
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions
6+
* are met:
7+
* 1. Redistributions of source code must retain the above copyright
8+
* notice, this list of conditions and the following disclaimer.
9+
* 2. Redistributions in binary form must reproduce the above copyright
10+
* notice, this list of conditions and the following disclaimer in the
11+
* documentation and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21+
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
*/
2525

2626
const EXPECTED_ASSERTION_COUNT = 1213680;
2727

2828
class Benchmark extends StartupBenchmark {
2929
lastResult;
3030
totalHash = 0xdeadbeef;
3131
samples = [];
32-
32+
3333
constructor(iterationCount) {
3434
super({
3535
iterationCount,
@@ -65,9 +65,9 @@ class Benchmark extends StartupBenchmark {
6565
runIteration(iteration) {
6666
// Module is loaded into PrismJSBenchmark
6767
let PrismJSBenchmark;
68-
eval(this.iterationSourceCodes[iteration])
68+
eval(this.iterationSourceCodes[iteration]);
6969
this.lastResult = PrismJSBenchmark.runTest(this.samples);
70-
70+
7171
for (const result of this.lastResult) {
7272
result.hash = this.quickHash(result.html);
7373
this.totalHash ^= result.hash;
@@ -80,7 +80,10 @@ class Benchmark extends StartupBenchmark {
8080
const sample = this.samples[i];
8181
const result = this.lastResult[i];
8282
console.assert(result.html.length > 0);
83-
console.assert(result.hash == sample.hash, `Invalid result.hash = ${result.hash}, expected ${sample.hash}`);
83+
console.assert(
84+
result.hash == sample.hash,
85+
`Invalid result.hash = ${result.hash}, expected ${sample.hash}`
86+
);
8487
}
8588
}
8689
}

0 commit comments

Comments
 (0)