File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
svelte/test/runtime/samples/binding-backflow Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
<script >
2
- import Counter from " ./lib/Counter.svelte" ;
2
+ export let foo;
3
+ let bar = ' baz' ;
4
+ foo .bar = bar;
3
5
</script >
4
6
5
- <div >
6
- Hello world!
7
- </div >
7
+ child: {typeof foo }
Original file line number Diff line number Diff line change 6
6
value = { foo: ' kid' }
7
7
}
8
8
9
+ if (testcase === ' init_mutate' ) {
10
+ value .foo = ' kid'
11
+ }
12
+
9
13
$: if (testcase === ' reactive_update' ) {
10
14
value = { foo: ' kid' }
11
15
}
Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ export default {
6
6
{ testcase : 'child_default_populate_parent' , value : undefined } ,
7
7
{ testcase : 'reactive_update' , value : { foo : 'mon' } } ,
8
8
{ testcase : 'reactive_mutate' , value : { foo : 'mon' } } ,
9
- { testcase : 'init_update' , value : { foo : 'mon' } }
9
+ { testcase : 'init_update' , value : { foo : 'mon' } } ,
10
+ { testcase : 'init_mutate' , value : { foo : 'mon' } }
10
11
]
11
12
} ;
12
13
} ,
@@ -36,5 +37,9 @@ export default {
36
37
p = parents [ 'init_update' ] ;
37
38
assert . deepEqual ( p . value , { foo : 'kid' } ) ;
38
39
assert . equal ( p . updates . length , 2 ) ;
40
+
41
+ p = parents [ 'init_mutate' ] ;
42
+ assert . deepEqual ( p . value , { foo : 'kid' } ) ;
43
+ assert . equal ( p . updates . length , 2 ) ;
39
44
}
40
45
} ;
You can’t perform that action at this time.
0 commit comments