From 95b9605ea789bcc40bce1e5e7461ebdc1b419304 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 29 May 2025 17:03:08 -0400 Subject: [PATCH] fix --- .../3-transform/client/visitors/VariableDeclaration.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js index e99e15839c..fbe1e5edb7 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js @@ -203,12 +203,7 @@ export function VariableDeclaration(node, context) { let expression = /** @type {Expression} */ (context.visit(value)); if (rune === '$derived') expression = b.thunk(expression); - declarations.push( - b.declarator( - declarator.id, - b.call('$.derived', rune === '$derived.by' ? value : b.thunk(value)) - ) - ); + declarations.push(b.declarator(declarator.id, b.call('$.derived', expression))); } } else { const init = /** @type {CallExpression} */ (declarator.init);