pull/13740/head
Simon Holthausen 2 years ago
parent 38738a8e33
commit c36784ccaf

@ -739,7 +739,11 @@ const instance_script = {
);
const bindings = ids.map((id) => state.scope.get(id.name));
const reassigned_bindings = bindings.filter((b) => b?.reassigned);
if (reassigned_bindings.length === 0 && !bindings.some((b) => b?.kind === 'store_sub') && node.body.expression.left.type === "Identifier") {
if (
reassigned_bindings.length === 0 &&
!bindings.some((b) => b?.kind === 'store_sub') &&
node.body.expression.left.type !== 'MemberExpression'
) {
let { start, end } = /** @type {{ start: number, end: number }} */ (
node.body.expression.right
);

@ -1,7 +1,7 @@
<script>
import { run } from 'svelte/legacy';
let count = 0;
let count = $state(0);
run(() => {
console.log(count);
});
@ -18,6 +18,9 @@
run(() => {
$count = 1;
});
run(() => {
$count.x = count;
});
</script>
<button onclick={() => count++}>increment</button>
<button onclick={() => count++}>increment</button>
Loading…
Cancel
Save