|
|
|
@ -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)))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|