Skip to content

Commit a8854e0

Browse files
committed
fix
1 parent e820fc5 commit a8854e0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/svelte/src/compiler/phases/3-transform/server/transform-server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,8 @@ export function server_component(analysis, options) {
20242024

20252025
if (
20262026
node.body.type === 'ExpressionStatement' &&
2027-
node.body.expression.type === 'AssignmentExpression'
2027+
node.body.expression.type === 'AssignmentExpression' &&
2028+
node.body.expression.left.type !== 'MemberExpression'
20282029
) {
20292030
for (const id of extract_identifiers(node.body.expression.left)) {
20302031
const binding = analysis.instance.scope.get(id.name);

packages/svelte/src/compiler/phases/scope.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
361361

362362
if (
363363
node.body.type === 'ExpressionStatement' &&
364-
node.body.expression.type === 'AssignmentExpression'
364+
node.body.expression.type === 'AssignmentExpression' &&
365+
node.body.expression.left.type !== 'MemberExpression'
365366
) {
366367
for (const id of extract_identifiers(node.body.expression.left)) {
367368
if (!id.name.startsWith('$')) {

0 commit comments

Comments
 (0)