Skip to content

Commit 5d9dd0b

Browse files
committed
feedback
1 parent b985eea commit 5d9dd0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ const global_visitors = {
415415
const args = /** @type {import('estree').Expression[]} */ (
416416
node.arguments.map((arg) => context.visit(arg))
417417
);
418-
return b.call('$.effect_root', ...args);
418+
// Just call the function directly
419+
return b.call(args[0]);
419420
}
420421

421422
if (rune === '$state.snapshot') {
@@ -578,7 +579,7 @@ const javascript_visitors_runes = {
578579
for (const declarator of node.declarations) {
579580
const init = declarator.init;
580581
const rune = get_rune(init, state.scope);
581-
if (!rune || rune === '$effect.tracking' || rune === '$inspect') {
582+
if (!rune || rune === '$effect.tracking' || rune === '$inspect' || rune === '$effect.root') {
582583
declarations.push(/** @type {import('estree').VariableDeclarator} */ (visit(declarator)));
583584
continue;
584585
}

0 commit comments

Comments
 (0)