File tree 3 files changed +20
-1
lines changed
test/runtime/samples/instrumentation-auto-subscription-self-assignment
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ export default function dom(
182
182
183
183
if ( node . operator === '=' && nodes_match ( node . left , node . right ) ) {
184
184
const dirty = names . filter ( name => {
185
- return scope . find_owner ( name ) === component . instance_scope ;
185
+ return name [ 0 ] === '$' || scope . find_owner ( name ) === component . instance_scope ;
186
186
} ) ;
187
187
188
188
if ( dirty . length ) component . has_reactive_assignments = true ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ html : `[]` ,
3
+
4
+ async test ( { assert, component, target } ) {
5
+ await component . go ( ) ;
6
+ assert . htmlEqual ( target . innerHTML , `[42]` ) ;
7
+ }
8
+ } ;
Original file line number Diff line number Diff line change
1
+ <script >
2
+ import { writable } from ' svelte/store' ;
3
+ const foo = writable ([]);
4
+ $: bar = $foo;
5
+ export function go () {
6
+ $foo .push (42 );
7
+ $foo = $foo;
8
+ }
9
+ </script >
10
+
11
+ {JSON .stringify (bar )}
You can’t perform that action at this time.
0 commit comments