mirror of https://github.com/sveltejs/svelte
Merge pull request #807 from sveltejs/gh-788
don't noop set/get until after component is destroyedpull/809/head
commit
e30ff542da
@ -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