Skip to content

Commit 0917ce7

Browse files
committed
this should work
1 parent e2b569f commit 0917ce7

File tree

1 file changed

+4
-5
lines changed
  • packages/svelte/src/compiler/phases/2-analyze

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,14 +787,13 @@ export function analyze_component(root, source, options) {
787787
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) {
788788
for (const specifier of node.specifiers) {
789789
if (specifier.local.type !== 'Identifier') continue;
790-
791-
const binding = analysis.module.scope.get(specifier.local.name);
790+
const name = specifier.local.name;
791+
const binding = analysis.module.scope.get(name);
792792
if (!binding) {
793-
const template_binding = analysis.template.scope.get(specifier.local.name);
794-
if (template_binding?.kind === 'snippet') {
793+
if ([...analysis.snippets].find((snippet) => snippet.expression.name === name)) {
795794
e.snippet_invalid_export(specifier);
796795
} else {
797-
e.export_undefined(specifier, specifier.local.name);
796+
e.export_undefined(specifier, name);
798797
}
799798
}
800799
}

0 commit comments

Comments
 (0)