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

Loading…
Cancel
Save