From 4ee33d4890b372583658ed048e7b618ec5cfdc73 Mon Sep 17 00:00:00 2001 From: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com> Date: Sun, 31 Aug 2025 00:06:04 -0700 Subject: [PATCH] ok *this* should fix it --- .../client/visitors/VariableDeclaration.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 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 29b9db25ae..92120b01bb 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 @@ -1,4 +1,4 @@ -/** @import { CallExpression, Expression, Identifier, Literal, Node, Program, VariableDeclaration, VariableDeclarator } from 'estree' */ +/** @import { AwaitExpression, CallExpression, Expression, Identifier, Literal, Node, Program, VariableDeclaration, VariableDeclarator } from 'estree' */ /** @import { Binding } from '#compiler' */ /** @import { ComponentContext, ParallelizedChunk } from '../types' */ import { dev, is_ignored, locate_node } from '../../../../state.js'; @@ -217,8 +217,15 @@ export function VariableDeclaration(node, context) { ); } } + return b.call( + '$.async_compose', + /** @type {Expression} */ ( + context.visit(/** @type {AwaitExpression} */ (value).argument) + ), + ...compose + ); } else { - value = visited; + let value = visited; if (rune === '$state' && is_proxy) { value = b.call('$.proxy', value); @@ -234,15 +241,8 @@ export function VariableDeclaration(node, context) { value = b.call('$.tag', value, b.literal(id.name)); } } + return value; } - - return parallelize && value.type === 'AwaitExpression' - ? b.call( - '$.async_compose', - /** @type {Expression} */ (context.visit(value.argument)), - ...compose - ) - : visited; }; if (declarator.id.type === 'Identifier') {