This commit is contained in:
Dustin Swan 2026-02-12 22:05:15 -07:00
parent 8c20a29b54
commit 68f4fbe9b3
No known key found for this signature in database
GPG key ID: 30D46587E2100467
5 changed files with 42 additions and 43 deletions

View file

@ -29,6 +29,7 @@ export function compile(ast: AST, useStore = true, bound = new Set<string>(), to
const newBound = new Set([...bound, ...ast.params]);
const params = ast.params.map(sanitizeName).join(') => (');
const id = astIdCounter++;
astRegistry.set(id, ast);
return `Object.assign((${params}) => ${compile(ast.body, useStore, newBound, topLevel)}, { _astId: (${id}) })`;
}