Skip to content

Commit a5a5b8d

Browse files
authored
tweak
1 parent e07672b commit a5a5b8d

File tree

1 file changed

+14
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function is_state_source(binding, analysis) {
3737
*/
3838
export function can_be_parallelized(expression, scope, analysis) {
3939
let has_closures = false;
40+
let should_stop = false;
4041
/** @type {Set<string>} */
4142
const references = new Set();
4243
walk(expression, null, {
@@ -52,9 +53,21 @@ export function can_be_parallelized(expression, scope, analysis) {
5253
if (is_reference(node, /** @type {Node} */ (path.at(-1)))) {
5354
references.add(node.name);
5455
}
56+
},
57+
MemberExpression(node, { stop }) {
58+
should_stop = true;
59+
stop();
60+
},
61+
CallExpression(node, { stop }) {
62+
should_stop = true;
63+
stop();
64+
},
65+
NewExpression(node, { stop }) {
66+
should_stop = true;
67+
stop();
5568
}
5669
});
57-
if (has_closures) {
70+
if (has_closures || should_stop) {
5871
return false;
5972
}
6073
for (const reference of references) {

0 commit comments

Comments
 (0)