fix: add `LabeledStatement` to `instance.ast` check

pull/16232/head
paoloricciuti 3 months ago
parent 06ddc8cbb2
commit 5ec63e7809

@ -441,7 +441,8 @@ export function analyze_component(root, source, options) {
!module.scope.references.keys().some((name) => ['$$props', '$$restProps'].includes(name)) &&
!instance.ast.body.some(
(node) =>
node.type === 'ExportNamedDeclaration' &&
node.type === 'LabeledStatement' ||
(node.type === 'ExportNamedDeclaration' &&
((node.declaration &&
node.declaration.type === 'VariableDeclaration' &&
node.declaration.kind === 'let') ||
@ -449,7 +450,7 @@ export function analyze_component(root, source, options) {
(specifier) =>
specifier.local.type === 'Identifier' &&
instance.scope.get(specifier.local.name)?.declaration_kind === 'let'
))
)))
),
tracing: false,
classes: new Map(),

Loading…
Cancel
Save