From 3147fbeb94258e01adf0bdfb6674aea6a28af7d8 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 22 Oct 2024 11:42:31 +0200 Subject: [PATCH] fixes --- packages/playwright-core/src/utils/sequence.ts | 11 +++++++---- packages/playwright-core/src/utils/stackTrace.ts | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/playwright-core/src/utils/sequence.ts b/packages/playwright-core/src/utils/sequence.ts index 2af5429bd6..27756fabeb 100644 --- a/packages/playwright-core/src/utils/sequence.ts +++ b/packages/playwright-core/src/utils/sequence.ts @@ -20,10 +20,13 @@ export function findRepeatedSubsequences(s: string[]): { sequence: string[]; cou let i = 0; const arraysEqual = (a1: string[], a2: string[]) => { - if (a1.length !== a2.length) return false; + if (a1.length !== a2.length) + return false; for (let j = 0; j < a1.length; j++) { - if (a1[j] !== a2[j]) return false; + if (a1[j] !== a2[j]) + return false; } + return true; }; @@ -41,9 +44,9 @@ export function findRepeatedSubsequences(s: string[]): { sequence: string[]; cou while ( i + p * k <= n && arraysEqual(s.slice(i + p * (k - 1), i + p * k), substr) - ) { + ) k += 1; - } + k -= 1; // Adjust k since it increments one extra time in the loop // Update the maximal repeating substring if necessary diff --git a/packages/playwright-core/src/utils/stackTrace.ts b/packages/playwright-core/src/utils/stackTrace.ts index 9969346f28..84d08b0184 100644 --- a/packages/playwright-core/src/utils/stackTrace.ts +++ b/packages/playwright-core/src/utils/stackTrace.ts @@ -16,7 +16,6 @@ import path from 'path'; import { parseStackTraceLine } from '../utilsBundle'; -import { isUnderTest } from './'; import type { StackFrame } from '@protocol/channels'; import { colors } from '../utilsBundle'; import { findRepeatedSubsequences } from './sequence';