Skip to content

Commit 4ee33d4

Browse files
committed
ok *this* should fix it
1 parent eb61f7a commit 4ee33d4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @import { CallExpression, Expression, Identifier, Literal, Node, Program, VariableDeclaration, VariableDeclarator } from 'estree' */
1+
/** @import { AwaitExpression, CallExpression, Expression, Identifier, Literal, Node, Program, VariableDeclaration, VariableDeclarator } from 'estree' */
22
/** @import { Binding } from '#compiler' */
33
/** @import { ComponentContext, ParallelizedChunk } from '../types' */
44
import { dev, is_ignored, locate_node } from '../../../../state.js';
@@ -217,8 +217,15 @@ export function VariableDeclaration(node, context) {
217217
);
218218
}
219219
}
220+
return b.call(
221+
'$.async_compose',
222+
/** @type {Expression} */ (
223+
context.visit(/** @type {AwaitExpression} */ (value).argument)
224+
),
225+
...compose
226+
);
220227
} else {
221-
value = visited;
228+
let value = visited;
222229
if (rune === '$state' && is_proxy) {
223230
value = b.call('$.proxy', value);
224231

@@ -234,15 +241,8 @@ export function VariableDeclaration(node, context) {
234241
value = b.call('$.tag', value, b.literal(id.name));
235242
}
236243
}
244+
return value;
237245
}
238-
239-
return parallelize && value.type === 'AwaitExpression'
240-
? b.call(
241-
'$.async_compose',
242-
/** @type {Expression} */ (context.visit(value.argument)),
243-
...compose
244-
)
245-
: visited;
246246
};
247247

248248
if (declarator.id.type === 'Identifier') {

0 commit comments

Comments
 (0)