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

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

@ -441,15 +441,16 @@ 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.declaration &&
node.declaration.type === 'VariableDeclaration' &&
node.declaration.kind === 'let') ||
node.specifiers.some(
(specifier) =>
specifier.local.type === 'Identifier' &&
instance.scope.get(specifier.local.name)?.declaration_kind === 'let'
))
node.type === 'LabeledStatement' ||
(node.type === 'ExportNamedDeclaration' &&
((node.declaration &&
node.declaration.type === 'VariableDeclaration' &&
node.declaration.kind === 'let') ||
node.specifiers.some(
(specifier) =>
specifier.local.type === 'Identifier' &&
instance.scope.get(specifier.local.name)?.declaration_kind === 'let'
)))
),
tracing: false,
classes: new Map(),

Loading…
Cancel
Save