replace destroy with noop on destroy

pull/7738/head
Rich Harris 8 years ago
parent 6ae5e32371
commit a2e85aec1d

@ -212,7 +212,6 @@ export default function dom(
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
${generator.stylesheet.hasStyles &&
options.css !== false &&
`if ( !document.getElementById( '${generator.stylesheet.id}-style' ) ) @add_css();`}

@ -5,8 +5,7 @@ export * from './transitions.js';
export * from './utils.js';
export function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -14,13 +13,13 @@ export function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
export function destroyDev(detach) {
if (this._destroyed) console.warn('Component was already destroyed');
destroy.call(this, detach);
this.destroy = function() {
console.warn('Component was already destroyed');
};
}
export function differs(a, b) {

@ -38,8 +38,7 @@ function setAttribute(node, attribute, value) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -47,8 +46,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -217,7 +214,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !document.getElementById( 'svelte-3590263702-style' ) ) add_css();
this._fragment = create_main_fragment( this._state, this );

@ -66,7 +66,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !document.getElementById( 'svelte-3590263702-style' ) ) add_css();
this._fragment = create_main_fragment( this._state, this );

@ -14,8 +14,7 @@ function assign(target) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -23,8 +22,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -171,8 +168,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -44,8 +44,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -34,8 +34,7 @@ function setAttribute(node, attribute, value) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -43,8 +42,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -197,7 +194,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !document.getElementById( 'svelte-2363328337-style' ) ) add_css();
this._fragment = create_main_fragment( this._state, this );

@ -50,7 +50,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !document.getElementById( 'svelte-2363328337-style' ) ) add_css();
this._fragment = create_main_fragment( this._state, this );

@ -47,8 +47,7 @@ function createText(data) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -56,8 +55,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -317,8 +314,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -157,8 +157,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -34,8 +34,7 @@ function createText(data) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -43,8 +42,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -208,8 +205,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -61,8 +61,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -38,8 +38,7 @@ function createComment() {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -47,8 +46,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -252,8 +249,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -101,8 +101,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -38,8 +38,7 @@ function createComment() {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -47,8 +46,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -228,8 +225,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -77,8 +77,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -28,8 +28,7 @@ function createText(data) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -37,8 +36,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -200,8 +197,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !options._root ) {
this._oncreate = [];
this._beforecreate = [];

@ -61,8 +61,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
if ( !options._root ) {
this._oncreate = [];
this._beforecreate = [];

@ -14,8 +14,7 @@ function assign(target) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -23,8 +22,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -163,8 +160,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
var oncreate = template.oncreate.bind( this );
if ( !options._root ) {

@ -36,8 +36,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
var oncreate = template.oncreate.bind( this );
if ( !options._root ) {

@ -14,8 +14,7 @@ function assign(target) {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -23,8 +22,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -173,8 +170,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -46,8 +46,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -38,8 +38,7 @@ function createComment() {
}
function destroy(detach) {
if (!this._destroyed) {
this.set = noop;
this.destroy = this.set = noop;
this.fire('destroy');
if (detach !== false) this._fragment.unmount();
@ -47,8 +46,6 @@ function destroy(detach) {
this._fragment = null;
this._state = {};
this._destroyed = true;
}
}
function differs(a, b) {
@ -412,8 +409,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

@ -261,8 +261,6 @@ function SvelteComponent ( options ) {
this._root = options._root || this;
this._yield = options._yield;
this._destroyed = false;
this._fragment = create_main_fragment( this._state, this );
if ( options.target ) {

Loading…
Cancel
Save