diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 21f0b6ef05..ccd5da26f3 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -1023,7 +1023,7 @@ export default class Component { }; for (const [name, node] of top_level_function_declarations) { - if (!checked.has(node) && is_hoistable(node)) { + if (is_hoistable(node)) { const variable = this.var_lookup.get(name); variable.hoistable = true; hoistable_nodes.add(node); diff --git a/test/runtime/samples/function-hoisting/_config.js b/test/runtime/samples/function-hoisting/_config.js new file mode 100644 index 0000000000..5a22ffaf0b --- /dev/null +++ b/test/runtime/samples/function-hoisting/_config.js @@ -0,0 +1,7 @@ +export default { + props: { + greeting: 'Good day' + }, + + html: '