fix: allow classes to be reassigned (#11794)

pull/11767/head
Rich Harris 1 year ago committed by GitHub
parent 4fef0eb08f
commit 5fb017df92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow classes to be reassigned

@ -476,7 +476,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
SwitchStatement: create_block_scope,
ClassDeclaration(node, { state, next }) {
if (node.id) state.scope.declare(node.id, 'normal', 'const', node);
if (node.id) state.scope.declare(node.id, 'normal', 'let', node);
next();
},

Loading…
Cancel
Save