Skip to content

Commit ae7e5bb

Browse files
committed
fix
1 parent 3bfcacc commit ae7e5bb

File tree

1 file changed

+5
-1
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/visitors/shared

1 file changed

+5
-1
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export function validate_assignment(node, argument, context) {
5757
) {
5858
const grandparent = get_parent(context.path, i - 1);
5959

60-
if (grandparent.type === 'MethodDefinition' && grandparent.kind === 'constructor') {
60+
if (
61+
grandparent.type === 'MethodDefinition' &&
62+
grandparent.kind === 'constructor' &&
63+
/** @type {number} */ (node.start) < /** @type {number} */ (field.node.start)
64+
) {
6165
e.state_field_invalid_assignment(node);
6266
}
6367

0 commit comments

Comments
 (0)