fix strange bug

pull/10240/head
Dominic Gannaway 3 years ago
parent b754fdddca
commit 6622b7ffa1

@ -1711,12 +1711,13 @@ export const template_visitors = {
const declaration = node.declaration.declarations[0]; const declaration = node.declaration.declarations[0];
// TODO we can almost certainly share some code with $derived(...) // TODO we can almost certainly share some code with $derived(...)
if (declaration.id.type === 'Identifier') { if (declaration.id.type === 'Identifier') {
// debugger
state.init.push( state.init.push(
b.const( b.const(
declaration.id, declaration.id,
b.call( b.call(
'$.derived', '$.derived',
b.thunk(/** @type {import('estree').Expression} */ (visit(declaration.init))) b.arrow([], /** @type {import('estree').Expression} */ (visit(declaration.init)))
) )
) )
); );

Loading…
Cancel
Save