mirror of https://github.com/sveltejs/svelte
Merge pull request #2161 from sveltejs/gh-2129
Prevent reactive declaration assignees from being dependenciespull/2188/head
commit
c019150112
@ -0,0 +1,11 @@
|
||||
export default {
|
||||
test({ assert, component }) {
|
||||
assert.deepEqual(component.foo, {});
|
||||
component.bar = 'hello';
|
||||
assert.deepEqual(component.foo, { hello: true });
|
||||
component.bar = 'world';
|
||||
assert.deepEqual(component.foo, { hello: true, world: true });
|
||||
component.bar = false;
|
||||
assert.deepEqual(component.foo, { hello: true, world: true });
|
||||
}
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
export let foo = {};
|
||||
export let bar;
|
||||
$: if (bar) {
|
||||
foo[bar] = true;
|
||||
}
|
||||
</script>
|
Loading…
Reference in new issue