mirror of https://github.com/sveltejs/svelte
dont noop set/get until after component is destroyed (fixes #788)
parent
865e84b856
commit
f5958584d9
@ -0,0 +1,26 @@
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
|
||||
data: {
|
||||
foo: 1
|
||||
},
|
||||
|
||||
test(assert, component) {
|
||||
const values = [];
|
||||
let valueOnDestroy;
|
||||
|
||||
component.on('destroy', () => {
|
||||
component.set({ foo: 2 });
|
||||
valueOnDestroy = component.get('foo');
|
||||
});
|
||||
|
||||
component.observe('foo', foo => {
|
||||
values.push(foo);
|
||||
});
|
||||
|
||||
component.destroy();
|
||||
|
||||
assert.deepEqual(values, [1, 2]);
|
||||
assert.equal(valueOnDestroy, 2);
|
||||
}
|
||||
};
|
@ -0,0 +1 @@
|
||||
empty
|
Loading…
Reference in new issue