Skip to content

Commit 7e5c295

Browse files
committed
triple equals for length checks
1 parent a9ee736 commit 7e5c295

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

webdriver-ts/src/benchmarkRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ async function main() {
377377

378378
let runFrameworks: FrameworkData[];
379379
let matchesDirectoryArg = (directoryName: string) =>
380-
frameworkArgument.length == 0 || frameworkArgument.some((arg: string) => arg == directoryName);
380+
frameworkArgument.length === 0 || frameworkArgument.some((arg: string) => arg == directoryName);
381381
runFrameworks = (await initializeFrameworks(benchmarkOptions, matchesDirectoryArg)).filter(
382382
(f) => f.keyed || config.BENCHMARK_RUNNER !== BenchmarkRunner.WEBDRIVER_AFTERFRAME
383383
);

webdriver-ts/src/forkedBenchmarkRunnerWebdriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ async function computeResultsCPU(
171171
layouts.forEach((l) => {
172172
console.log("layout event", l.end - clicks[0].ts);
173173
});
174-
} else if (layouts.length == 0) {
174+
} else if (layouts.length === 0) {
175175
console.log("WARNING: exactly one layout event is expected", eventsAfterClick);
176176
lastLayoutEvent = clicks[0];
177177
}
178178

179179
let paintsP = R.filter(type_eq("paint"))(eventsAfterClick);
180180

181181
paintsP = R.filter((e: TimingResult) => e.ts > lastLayoutEvent.end)(paintsP);
182-
if (paintsP.length == 0) {
182+
if (paintsP.length === 0) {
183183
console.log("ERROR: No paint event found");
184184
throw "No paint event found";
185185
}

webdriver-ts/src/isCSPCompliant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function runBench(
4545
) {
4646
let runFrameworks;
4747
let matchesDirectoryArg = (directoryName: string) =>
48-
allArgs.length == 0 || allArgs.some((arg: string) => arg == directoryName);
48+
allArgs.length === 0 || allArgs.some((arg: string) => arg == directoryName);
4949
runFrameworks = await initializeFrameworks(benchmarkOptions, matchesDirectoryArg);
5050
console.log("Frameworks that will be checked", runFrameworks.map((f) => f.fullNameWithKeyedAndVersion).join(" "));
5151

webdriver-ts/src/isKeyed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ async function runBench(
253253
) {
254254
let runFrameworks;
255255
let matchesDirectoryArg = (directoryName: string) =>
256-
frameworkArgument.length == 0 || frameworkArgument.some((arg: string) => arg == directoryName);
256+
frameworkArgument.length === 0 || frameworkArgument.some((arg: string) => arg == directoryName);
257257
runFrameworks = await initializeFrameworks(benchmarkOptions, matchesDirectoryArg);
258258
console.log("Frameworks that will be checked", runFrameworks.map((f) => f.fullNameWithKeyedAndVersion).join(" "));
259259

webdriver-ts/src/timeline.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export async function computeResultsCPU(
153153
// Find mousedown event. This is the start of the benchmark
154154
let mousedowns = R.filter(type_eq("mousedown"))(events);
155155
// Invariant: There must be exactly one click event
156-
if (mousedowns.length == 0) {
156+
if (mousedowns.length === 0) {
157157
console.log("no mousedown event", fileName);
158158
} else if (mousedowns.length == 1) {
159159
console.log("one mousedown event", fileName);
@@ -216,7 +216,7 @@ export async function computeResultsCPU(
216216
let numberCommits = allCommitsAfterClick.length;
217217
if (!commit) {
218218
console.log("INFO: No commit event found according to filter", fileName);
219-
if (allCommitsAfterClick.length == 0) {
219+
if (allCommitsAfterClick.length === 0) {
220220
console.log("ERROR: No commit event found for", fileName);
221221
throw "No commit event found for " + fileName;
222222
} else {

webdriver-ts/src/webdriverCDPAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export async function findByXPath(driver: WebDriver, path: string, isInButtonAre
7474
}
7575
} else {
7676
let elems = await n.findElements(By.css(p.tagName + ":nth-of-type(" + p.index + ")"));
77-
if (elems == null || elems.length == 0) {
77+
if (elems == null || elems.length === 0) {
7878
return null;
7979
}
8080
elem = elems[0];

0 commit comments

Comments
 (0)