Skip to content

Commit 1482e3e

Browse files
committed
add explanatory note
1 parent 87963cf commit 1482e3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ function build_assignment(operator, left, right, context) {
4646
}
4747

4848
if (context.state.in_constructor) {
49+
// inside the constructor, we can assign to `this.#foo.v` rather than using `$.set`,
50+
// since nothing is tracking the signal at this point
4951
return b.assignment(operator, /** @type {Pattern} */ (context.visit(left)), value);
5052
}
5153

0 commit comments

Comments
 (0)