Skip to content

Commit 5fb017d

Browse files
authored
fix: allow classes to be reassigned (#11794)
1 parent 4fef0eb commit 5fb017d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/gentle-wasps-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: allow classes to be reassigned

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
476476
SwitchStatement: create_block_scope,
477477

478478
ClassDeclaration(node, { state, next }) {
479-
if (node.id) state.scope.declare(node.id, 'normal', 'const', node);
479+
if (node.id) state.scope.declare(node.id, 'normal', 'let', node);
480480
next();
481481
},
482482

0 commit comments

Comments
 (0)