mirror of https://github.com/sveltejs/svelte
mark reassigned/mutated values as non-hoistable - fixes #2731
parent
64c56eddcd
commit
d8445e6350
@ -0,0 +1,9 @@
|
|||||||
|
export default {
|
||||||
|
html: `1-2`,
|
||||||
|
|
||||||
|
async test({ assert, component, target }) {
|
||||||
|
await component.update();
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `3-4`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,14 @@
|
|||||||
|
<script>
|
||||||
|
let foo = () => 1;
|
||||||
|
|
||||||
|
function bar() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update() {
|
||||||
|
foo = () => 3;
|
||||||
|
bar = () => 4;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{foo()}-{bar()}
|
Loading…
Reference in new issue