Skip to content

Commit a559010

Browse files
committed
refactor(linter/plugins): add TODO comment about more efficient visitor compilation (oxc-project#18949)
Just add a TODO comment about how we could make visitor compilation more efficient where some selectors match all nodes.
1 parent 6b32cc8 commit a559010

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/oxlint/src-js/plugins/visitor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ export function addVisitorToCompiled(visitor: Visitor): void {
352352
}
353353

354354
// `*` selector or some other selector that matches all node types
355+
// TODO: Add 2 arrays for "enter all" and "exit all" selectors.
356+
// Where visitor contains multiple selectors which match all node types, this would avoid merging them
357+
// into a single visit function 100+ times for each node type. Could just merge them once and assign the same
358+
// merged function to all node types (except those which have other visit functions).
355359
for (typeId = 0; typeId < LEAF_NODE_TYPES_COUNT; typeId++) {
356360
addLeafVisitFn(typeId, visitProp);
357361
}

0 commit comments

Comments
 (0)