File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
tests/migrate/samples/effects Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -739,7 +739,11 @@ const instance_script = {
739739 ) ;
740740 const bindings = ids . map ( ( id ) => state . scope . get ( id . name ) ) ;
741741 const reassigned_bindings = bindings . filter ( ( b ) => b ?. reassigned ) ;
742- if ( reassigned_bindings . length === 0 && ! bindings . some ( ( b ) => b ?. kind === 'store_sub' ) && node . body . expression . left . type === "Identifier" ) {
742+ if (
743+ reassigned_bindings . length === 0 &&
744+ ! bindings . some ( ( b ) => b ?. kind === 'store_sub' ) &&
745+ node . body . expression . left . type !== 'MemberExpression'
746+ ) {
743747 let { start, end } = /** @type {{ start: number, end: number } } */ (
744748 node . body . expression . right
745749 ) ;
Original file line number Diff line number Diff line change 11<script >
22 import { run } from ' svelte/legacy' ;
33
4- let count = 0 ;
4+ let count = $state ( 0 ) ;
55 run (() => {
66 console .log (count);
77 });
1818 run (() => {
1919 $count = 1 ;
2020 });
21+ run (() => {
22+ $count .x = count;
23+ });
2124 </script >
2225
23- <button onclick ={() => count ++ }>increment</button >
26+ <button onclick ={() => count ++ }>increment</button >
You can’t perform that action at this time.
0 commit comments