File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
tests/migrate/samples/effects-with-alias-run Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export function migrate(source) {
71
71
state = { ...state , scope : analysis . template . scope } ;
72
72
walk ( parsed . fragment , state , template ) ;
73
73
74
- const run_import = `import { run${ state . run_name === 'run' ? '' : `as ${ state . run_name } ` } } from 'svelte/legacy';` ;
74
+ const run_import = `import { run${ state . run_name === 'run' ? '' : ` as ${ state . run_name } ` } } from 'svelte/legacy';` ;
75
75
let added_legacy_import = false ;
76
76
77
77
if ( state . props . length > 0 || analysis . uses_rest_props || analysis . uses_props ) {
Original file line number Diff line number Diff line change
1
+ <script >
2
+ let count = 0 ;
3
+ let run = true ;
4
+ $: console .log (count);
5
+ $: if (count > 10 && run) {
6
+ alert (' too high' )
7
+ }
8
+ $: {
9
+ console .log (' foo' );
10
+ if (x) break $;
11
+ console .log (' bar' );
12
+ }
13
+ $: $count = 1 ;
14
+ </script >
Original file line number Diff line number Diff line change
1
+ <script >
2
+ import { run as run_1 } from ' svelte/legacy' ;
3
+
4
+ let count = 0 ;
5
+ let run = true ;
6
+ run_1 (() => {
7
+ console .log (count);
8
+ });
9
+ run_1 (() => {
10
+ if (count > 10 && run) {
11
+ alert (' too high' )
12
+ }
13
+ });
14
+ run_1 (() => {
15
+ console .log (' foo' );
16
+ if (x) return ;
17
+ console .log (' bar' );
18
+ });
19
+ run_1 (() => {
20
+ $count = 1 ;
21
+ });
22
+ </script >
You can’t perform that action at this time.
0 commit comments