Skip to content

Commit

Permalink
fix(5019): mark imported stores as hoistable
Browse files Browse the repository at this point in the history
  • Loading branch information
skippednote committed Jun 23, 2020
1 parent c7e8e6f commit 7a52cec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compiler/compile/Component.ts
Expand Up @@ -632,7 +632,6 @@ export default class Component {
this.add_var({
name,
initialised: instance_scope.initialised_declarations.has(name),
hoistable: true,
writable
});

Expand Down Expand Up @@ -1153,7 +1152,9 @@ export default class Component {
for (const specifier of specifiers) {
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;
}
}
}
}
Expand Down

0 comments on commit 7a52cec

Please sign in to comment.