diff --git a/src/compile/Component.ts b/src/compile/Component.ts index bf2fdf9a5a..7d4aa72f03 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -1002,9 +1002,11 @@ export default class Component { if (walking.has(other_declaration)) { hoistable = false; + } else if (other_declaration.type === 'ExportNamedDeclaration' && walking.has(other_declaration.declaration)) { + hoistable = false; } else if (!is_hoistable(other_declaration)) { hoistable = false; - } + } } else { diff --git a/test/runtime/samples/export-function-hoisting/_config.js b/test/runtime/samples/export-function-hoisting/_config.js new file mode 100644 index 0000000000..c56851d065 --- /dev/null +++ b/test/runtime/samples/export-function-hoisting/_config.js @@ -0,0 +1,3 @@ +export default { + html: 'Compile plz' +} diff --git a/test/runtime/samples/export-function-hoisting/main.svelte b/test/runtime/samples/export-function-hoisting/main.svelte new file mode 100644 index 0000000000..4b54049ed9 --- /dev/null +++ b/test/runtime/samples/export-function-hoisting/main.svelte @@ -0,0 +1,11 @@ + + +Compile plz