Skip to content

Commit 0901a1b

Browse files
committed
fix
1 parent dd4b8b9 commit 0901a1b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ const callees = {
5252
* @returns {Expression | null}
5353
*/
5454
function build_assignment(operator, left, right, context) {
55-
if (
56-
context.state.analysis.runes &&
57-
left.type === 'MemberExpression' &&
58-
left.object.type === 'ThisExpression'
59-
) {
55+
if (context.state.analysis.runes && left.type === 'MemberExpression') {
6056
const name = get_name(left.property);
6157
const field = name && context.state.state_fields.get(name);
6258

@@ -74,7 +70,7 @@ function build_assignment(operator, left, right, context) {
7470
let value = /** @type {Expression} */ (context.visit(right, child_state));
7571

7672
if (dev) {
77-
const declaration = context.path.find(
73+
const declaration = context.path.findLast(
7874
(parent) => parent.type === 'ClassDeclaration' || parent.type === 'ClassExpression'
7975
);
8076
value = b.call(

0 commit comments

Comments
 (0)