Skip to content

Commit 8e95b20

Browse files
NullVoxPopuliclaude
andcommitted
Make the scope bag an object instead of an array
Now that the scope bag is a `Record<string, unknown>`, the lexical symbol names are always carried alongside their values. This eliminates the need for the `lexicalSymbols` slot in the wire format block (previously only available when `debugSymbols` was enabled) and allows `meta()` to derive `lexical` names and `scopeValues` directly from the scope object's keys and values. See also: upstream PR #21224, PR #21068. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 468a145 commit 8e95b20

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

packages/@glimmer/compiler/lib/compiler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ export function precompile(
123123
): TemplateJavascript {
124124
const [block, usedLocals] = precompileJSON(source, options);
125125

126-
if ('emit' in options && options.emit?.debugSymbols && usedLocals.length > 0) {
127-
block.push(usedLocals);
128-
}
126+
// lexical symbol names are now carried by the scope object itself (as keys),
127+
// so we no longer need to push them into the wire format block for debug symbols.
129128

130129
const moduleName = options.meta?.moduleName;
131130
const idFn = options.id || defaultId;

packages/@glimmer/interfaces/lib/compile/wire-format/api.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ export type SerializedTemplateBlock = [
373373
statements: Statements.Statement[],
374374
locals: string[],
375375
upvars: string[],
376-
lexicalSymbols?: string[],
377376
];
378377

379378
/**

0 commit comments

Comments
 (0)