add component.destroyed property (fixes #935)

pull/948/head
Rich Harris 8 years ago
parent 14b27b71e1
commit 8061799f66

@ -16,6 +16,7 @@ export function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
export function destroyDev(detach) { export function destroyDev(detach) {
@ -188,6 +189,7 @@ export function _unmount() {
} }
export var proto = { export var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,
@ -202,6 +204,7 @@ export var proto = {
}; };
export var protoDev = { export var protoDev = {
destroyed: false,
destroy: destroyDev, destroy: destroyDev,
get: get, get: get,
fire: fire, fire: fire,

@ -49,6 +49,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -178,6 +179,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -25,6 +25,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -154,6 +155,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -25,6 +25,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -154,6 +155,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -45,6 +45,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -174,6 +175,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -37,6 +37,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -166,6 +167,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -45,6 +45,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -174,6 +175,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -57,6 +57,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -186,6 +187,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -37,6 +37,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -166,6 +167,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -41,6 +41,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -170,6 +171,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -45,6 +45,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -174,6 +175,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -43,6 +43,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -172,6 +173,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -60,6 +60,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -189,6 +190,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -53,6 +53,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -182,6 +183,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -39,6 +39,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -168,6 +169,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -25,6 +25,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -154,6 +155,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -25,6 +25,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -154,6 +155,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -49,6 +49,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -178,6 +179,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -45,6 +45,7 @@ function destroy(detach) {
if (detach !== false) this._fragment.u(); if (detach !== false) this._fragment.u();
this._fragment.d(); this._fragment.d();
this._fragment = this._state = null; this._fragment = this._state = null;
this.destroyed = true;
} }
function differs(a, b) { function differs(a, b) {
@ -174,6 +175,7 @@ function _unmount() {
} }
var proto = { var proto = {
destroyed: false,
destroy: destroy, destroy: destroy,
get: get, get: get,
fire: fire, fire: fire,

@ -0,0 +1,7 @@
export default {
test(assert, component) {
assert.ok(!component.destroyed);
component.destroy();
assert.ok(component.destroyed);
}
};
Loading…
Cancel
Save