Skip to content

Commit ebd0447

Browse files
NullVoxPopuli-ai-agentNullVoxPopuliclaude
committed
Revert unnecessary change to normalize.ts (#21255)
The change to make lexicalScope optional with a localsSet fallback is never exercised — the only caller (compiler.ts) always passes lexicalScope explicitly. Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f1797a1 commit ebd0447

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

packages/@glimmer/syntax/lib/v2/normalize.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type { PresentArray } from '@glimmer/interfaces';
22
import { asPresentArray, isPresentArray, localAssert } from '@glimmer/debug-util';
33
import { assign } from '@glimmer/util';
44

5-
import type { PrecompileOptions } from '../parser/tokenizer-event-handlers';
5+
import type {
6+
PrecompileOptions,
7+
PrecompileOptionsWithLexicalScope,
8+
} from '../parser/tokenizer-event-handlers';
69
import type { SourceLocation } from '../source/location';
710
import type { Source } from '../source/source';
811
import type { SourceSpan } from '../source/span';
@@ -32,7 +35,7 @@ import {
3235

3336
export function normalize(
3437
source: Source,
35-
options: PrecompileOptions & { lexicalScope?: (variable: string) => boolean }
38+
options: PrecompileOptionsWithLexicalScope = { lexicalScope: () => false }
3639
): [ast: ASTv2.Template, locals: string[]] {
3740
let ast = preprocess(source, options);
3841

@@ -42,12 +45,10 @@ export function normalize(
4245
locals: ast.blockParams,
4346
keywords: options.keywords ?? [],
4447
};
45-
let localsSet = new Set(normalizeOptions.locals);
46-
let lexicalScope = options.lexicalScope ?? ((name: string) => localsSet.has(name));
4748

4849
let top = SymbolTable.top(normalizeOptions.locals, normalizeOptions.keywords, {
4950
customizeComponentName: options.customizeComponentName ?? ((name) => name),
50-
lexicalScope,
51+
lexicalScope: options.lexicalScope,
5152
});
5253
let block = new BlockContext(source, normalizeOptions, top);
5354
let normalizer = new StatementNormalizer(block);

0 commit comments

Comments
 (0)