From 689eb7750d3666c504731430c6705cb421c81a27 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 21 Oct 2024 17:29:57 +0200 Subject: [PATCH] refactor --- .../playwright-core/src/utils/isomorphic/locatorGenerators.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts b/packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts index df4a0946a7..e46ebcc1f1 100644 --- a/packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts +++ b/packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts @@ -194,7 +194,6 @@ function innerAsLocators(factory: LocatorFactory, parsed: ParsedSelector, isFram const selectorPart = stringifySelector({ parts: [part] }, /* forceEngineName */ true); locatorPartWithEngine = factory.generateLocator(base, 'default', selectorPart); } - const locatorParts = [locatorPart, locatorPartWithEngine].filter(Boolean) as string[]; if (nextPart && nextPart.name === 'internal:control' && (nextPart.body as string) === 'enter-frame') { // two options plus engine name: @@ -221,7 +220,7 @@ function innerAsLocators(factory: LocatorFactory, parsed: ParsedSelector, isFram continue; } - tokens.push(locatorParts); + tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean) as string[]); } return combineTokens(factory, tokens, maxOutputSize);