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 = {
739
739
) ;
740
740
const bindings = ids . map ( ( id ) => state . scope . get ( id . name ) ) ;
741
741
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
+ ) {
743
747
let { start, end } = /** @type {{ start: number, end: number } } */ (
744
748
node . body . expression . right
745
749
) ;
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { run } from ' svelte/legacy' ;
3
3
4
- let count = 0 ;
4
+ let count = $state ( 0 ) ;
5
5
run (() => {
6
6
console .log (count);
7
7
});
18
18
run (() => {
19
19
$count = 1 ;
20
20
});
21
+ run (() => {
22
+ $count .x = count;
23
+ });
21
24
</script >
22
25
23
- <button onclick ={() => count ++ }>increment</button >
26
+ <button onclick ={() => count ++ }>increment</button >
You can’t perform that action at this time.
0 commit comments