Skip to content

Commit 7788c30

Browse files
committed
try this
1 parent 464d7b6 commit 7788c30

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/** @import { Identifier, Node } from 'estree' */
2-
/** @import { Context } from '../types' */
2+
/** @import { ComponentContext } from '../types' */
33
import is_reference from 'is-reference';
44
import * as b from '#compiler/builders';
55
import { build_getter } from '../utils.js';
66

77
/**
88
* @param {Identifier} node
9-
* @param {Context} context
9+
* @param {ComponentContext} context
1010
*/
1111
export function Identifier(node, context) {
1212
const parent = /** @type {Node} */ (context.path.at(-1));
@@ -35,6 +35,9 @@ export function Identifier(node, context) {
3535
return b.id('$$props');
3636
}
3737
}
38+
if (binding && context.state.current_parallelized_chunk?.bindings?.includes(binding)) {
39+
context.state.current_parallelized_chunk = null;
40+
}
3841

3942
return build_getter(node, context.state);
4043
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ export function VariableDeclaration(node, context) {
5353
init.argument,
5454
context.state.scope,
5555
context.state.analysis,
56-
context.state.current_parallelized_chunk?.bindings ?? []
56+
[
57+
...(context.state.current_parallelized_chunk?.bindings ?? []),
58+
...context.state.scope.get_bindings(declarator)
59+
]
5760
);
5861
if (parallelize) {
5962
const bindings = context.state.scope.get_bindings(declarator);

0 commit comments

Comments
 (0)