fix(5019): mark imported stores as hoistable

pull/5022/head
Bassam Ismail 5 years ago
parent c7e8e6fee9
commit 7a52cec1e0

@ -632,7 +632,6 @@ export default class Component {
this.add_var({ this.add_var({
name, name,
initialised: instance_scope.initialised_declarations.has(name), initialised: instance_scope.initialised_declarations.has(name),
hoistable: true,
writable writable
}); });
@ -1153,7 +1152,9 @@ export default class Component {
for (const specifier of specifiers) { for (const specifier of specifiers) {
const variable = var_lookup.get(specifier.local.name); const variable = var_lookup.get(specifier.local.name);
if (!variable.mutated) variable.hoistable = true; if (!variable.mutated || var_lookup.get(`$${specifier.local.name}`)) {
variable.hoistable = true;
}
} }
} }
} }

Loading…
Cancel
Save