From afc18131f4518783b7bf42ff7e81491639e5328d Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:33:14 +0800 Subject: [PATCH] fix(ci): reuse shared JavaScript AST child traversal --- src/domain/javascript/electronCallPathBlockPrefixes.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/domain/javascript/electronCallPathBlockPrefixes.ts b/src/domain/javascript/electronCallPathBlockPrefixes.ts index 0af1a9df08..8df1bc04e4 100644 --- a/src/domain/javascript/electronCallPathBlockPrefixes.ts +++ b/src/domain/javascript/electronCallPathBlockPrefixes.ts @@ -1,4 +1,5 @@ import * as t from "@babel/types"; +import { childNodes } from "./javascriptSemanticTraversal.js"; /** Syntax alone can establish an exit, but never a branch's contextual truth. */ export type ElectronStatementFallthrough = @@ -104,13 +105,8 @@ export class ElectronCallPathBlockPrefixes { } if (!local) breaks.add(node.label.name); } - for (const key of t.VISITOR_KEYS[node.type] ?? []) { - const value = (node as unknown as Record)[key]; - const children = Array.isArray(value) ? value : [value]; - for (const child of children) { - if (t.isNode(child)) pending.push({ node: child, depth: depth + 1 }); - } - } + for (const child of childNodes(node)) + pending.push({ node: child, depth: depth + 1 }); } return { ...FALLTHROUGH, breaks, uncertain }; }