fix: correctly compile $effect.root in svelte modules

pull/12315/head
Dominic Gannaway 2 years ago
parent b2448dcc5c
commit 4ce5f37c24

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: correctly compile $effect.root in svelte modules

@ -411,6 +411,13 @@ const global_visitors = {
return b.literal(false);
}
if (rune === '$effect.root') {
const args = /** @type {import('estree').Expression[]} */ (
node.arguments.map((arg) => context.visit(arg))
);
return b.call('$.effect_root', ...args);
}
if (rune === '$state.snapshot') {
return /** @type {import('estree').Expression} */ (context.visit(node.arguments[0]));
}

Loading…
Cancel
Save