Skip to content

Commit 5ec63e7

Browse files
committed
fix: add LabeledStatement to instance.ast check
1 parent 06ddc8c commit 5ec63e7

File tree

1 file changed

+10
-9
lines changed
  • packages/svelte/src/compiler/phases/2-analyze

1 file changed

+10
-9
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,16 @@ export function analyze_component(root, source, options) {
441441
!module.scope.references.keys().some((name) => ['$$props', '$$restProps'].includes(name)) &&
442442
!instance.ast.body.some(
443443
(node) =>
444-
node.type === 'ExportNamedDeclaration' &&
445-
((node.declaration &&
446-
node.declaration.type === 'VariableDeclaration' &&
447-
node.declaration.kind === 'let') ||
448-
node.specifiers.some(
449-
(specifier) =>
450-
specifier.local.type === 'Identifier' &&
451-
instance.scope.get(specifier.local.name)?.declaration_kind === 'let'
452-
))
444+
node.type === 'LabeledStatement' ||
445+
(node.type === 'ExportNamedDeclaration' &&
446+
((node.declaration &&
447+
node.declaration.type === 'VariableDeclaration' &&
448+
node.declaration.kind === 'let') ||
449+
node.specifiers.some(
450+
(specifier) =>
451+
specifier.local.type === 'Identifier' &&
452+
instance.scope.get(specifier.local.name)?.declaration_kind === 'let'
453+
)))
453454
),
454455
tracing: false,
455456
classes: new Map(),

0 commit comments

Comments
 (0)