diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index e3bb7e6697..9b9d888cf6 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -294,7 +294,7 @@ export default function dom( ${props.map(prop => deindent` get ${prop}() { - return this.get('${prop}'); + return this.get().${prop}; } set ${prop}(value) { diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index c58cbdcea3..093fb642a7 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js b/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js index 1c6d4db78a..ed6fef0f3d 100644 --- a/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js +++ b/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js b/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js index 1c6d4db78a..ed6fef0f3d 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle.js b/test/js/samples/collapses-text-around-comments/expected-bundle.js index 1c6d4db78a..ed6fef0f3d 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 959b6fea56..235f57755d 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -57,8 +57,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 959b6fea56..235f57755d 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -57,8 +57,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index b7f9dcbbb9..dc4f6dbf0d 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 5ed48c2966..5347ce59a1 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index f4076b1213..8802fe3002 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js index edf44bfd7a..c2f35f7b98 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/deconflict-builtins/_actual-bundle-v2.js b/test/js/samples/deconflict-builtins/_actual-bundle-v2.js index e895d021e6..2f9dd2db1d 100644 --- a/test/js/samples/deconflict-builtins/_actual-bundle-v2.js +++ b/test/js/samples/deconflict-builtins/_actual-bundle-v2.js @@ -83,8 +83,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/deconflict-builtins/expected-bundle-v2.js b/test/js/samples/deconflict-builtins/expected-bundle-v2.js index e895d021e6..2f9dd2db1d 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle-v2.js +++ b/test/js/samples/deconflict-builtins/expected-bundle-v2.js @@ -83,8 +83,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index 1e9eb4b709..0bfddd1f0d 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -83,8 +83,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 8d23561dec..214eed9578 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js index c048d39b99..e0ff6a1171 100644 --- a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js @@ -80,8 +80,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); @@ -93,17 +91,6 @@ function on(eventName, handler) { }; } -function onDev(eventName, handler) { - if (eventName === 'teardown') { - console.warn( - "Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2" - ); - return this.on('destroy', handler); - } - - return on.call(this, eventName, handler); -} - function set(newState) { this._set(assign({}, newState)); if (this.root._lock) return; @@ -162,7 +149,7 @@ var protoDev = { destroy: destroyDev, get, fire, - on: onDev, + on, set: setDev, _recompute: noop, _set, diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js index c048d39b99..e0ff6a1171 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js @@ -80,8 +80,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); @@ -93,17 +91,6 @@ function on(eventName, handler) { }; } -function onDev(eventName, handler) { - if (eventName === 'teardown') { - console.warn( - "Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2" - ); - return this.on('destroy', handler); - } - - return on.call(this, eventName, handler); -} - function set(newState) { this._set(assign({}, newState)); if (this.root._lock) return; @@ -162,7 +149,7 @@ var protoDev = { destroy: destroyDev, get, fire, - on: onDev, + on, set: setDev, _recompute: noop, _set, diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index ef60f3ec41..effef47cb9 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -80,8 +80,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); @@ -93,17 +91,6 @@ function on(eventName, handler) { }; } -function onDev(eventName, handler) { - if (eventName === 'teardown') { - console.warn( - "Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2" - ); - return this.on('destroy', handler); - } - - return on.call(this, eventName, handler); -} - function set(newState) { this._set(assign({}, newState)); if (this.root._lock) return; @@ -162,7 +149,7 @@ var protoDev = { destroy: destroyDev, get, fire, - on: onDev, + on, set: setDev, _recompute: noop, _set, diff --git a/test/js/samples/do-use-dataset/_actual-bundle-v2.js b/test/js/samples/do-use-dataset/_actual-bundle-v2.js index d16e73a487..32af7494c3 100644 --- a/test/js/samples/do-use-dataset/_actual-bundle-v2.js +++ b/test/js/samples/do-use-dataset/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/do-use-dataset/expected-bundle-v2.js b/test/js/samples/do-use-dataset/expected-bundle-v2.js index d16e73a487..32af7494c3 100644 --- a/test/js/samples/do-use-dataset/expected-bundle-v2.js +++ b/test/js/samples/do-use-dataset/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index d16e73a487..32af7494c3 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js b/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js index 925c6e692b..5e9def1913 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js index 925c6e692b..5e9def1913 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js index 925c6e692b..5e9def1913 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js b/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js index 3ad8d8e988..54b8382a2d 100644 --- a/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js index 3ad8d8e988..54b8382a2d 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js index 3ad8d8e988..54b8382a2d 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/each-block-changed-check/_actual-bundle-v2.js b/test/js/samples/each-block-changed-check/_actual-bundle-v2.js index 5a2805c669..89c3cab243 100644 --- a/test/js/samples/each-block-changed-check/_actual-bundle-v2.js +++ b/test/js/samples/each-block-changed-check/_actual-bundle-v2.js @@ -85,8 +85,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/each-block-changed-check/expected-bundle-v2.js b/test/js/samples/each-block-changed-check/expected-bundle-v2.js index 5a2805c669..89c3cab243 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle-v2.js +++ b/test/js/samples/each-block-changed-check/expected-bundle-v2.js @@ -85,8 +85,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index 80b5d1220c..846fea0ba7 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -85,8 +85,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 977e92dec6..5d85e177e1 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); @@ -173,7 +171,7 @@ function create_main_fragment(component, state) { }, d: function destroy$$1() { - foo_handler[foo_handler.destroy ? 'destroy' : 'teardown'](); + foo_handler.destroy(); } }; } diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index bfec447406..3975641534 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -39,7 +39,7 @@ function create_main_fragment(component, state) { }, d: function destroy() { - foo_handler[foo_handler.destroy ? 'destroy' : 'teardown'](); + foo_handler.destroy(); } }; } diff --git a/test/js/samples/head-no-whitespace/_actual-bundle-v2.js b/test/js/samples/head-no-whitespace/_actual-bundle-v2.js index cb51aacad9..7f88574b70 100644 --- a/test/js/samples/head-no-whitespace/_actual-bundle-v2.js +++ b/test/js/samples/head-no-whitespace/_actual-bundle-v2.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/head-no-whitespace/expected-bundle-v2.js b/test/js/samples/head-no-whitespace/expected-bundle-v2.js index cb51aacad9..7f88574b70 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle-v2.js +++ b/test/js/samples/head-no-whitespace/expected-bundle-v2.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index cb51aacad9..7f88574b70 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -65,8 +65,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-no-update/_actual-bundle-v2.js b/test/js/samples/if-block-no-update/_actual-bundle-v2.js index 12168d6294..1760a2ca60 100644 --- a/test/js/samples/if-block-no-update/_actual-bundle-v2.js +++ b/test/js/samples/if-block-no-update/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-no-update/expected-bundle-v2.js b/test/js/samples/if-block-no-update/expected-bundle-v2.js index 12168d6294..1760a2ca60 100644 --- a/test/js/samples/if-block-no-update/expected-bundle-v2.js +++ b/test/js/samples/if-block-no-update/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-no-update/expected-bundle.js b/test/js/samples/if-block-no-update/expected-bundle.js index 9f75086f35..303bd84821 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-simple/_actual-bundle-v2.js b/test/js/samples/if-block-simple/_actual-bundle-v2.js index 76e6919ebd..f71aafff94 100644 --- a/test/js/samples/if-block-simple/_actual-bundle-v2.js +++ b/test/js/samples/if-block-simple/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-simple/expected-bundle-v2.js b/test/js/samples/if-block-simple/expected-bundle-v2.js index 76e6919ebd..f71aafff94 100644 --- a/test/js/samples/if-block-simple/expected-bundle-v2.js +++ b/test/js/samples/if-block-simple/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 676d6d0d4e..7fe3bd33d7 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js index f15569295a..bd3bacfac2 100644 --- a/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js index f15569295a..bd3bacfac2 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js index f15569295a..bd3bacfac2 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js index 77130c71b3..4119905682 100644 --- a/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js b/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js index 77130c71b3..4119905682 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle.js b/test/js/samples/inline-style-optimized-url/expected-bundle.js index 77130c71b3..4119905682 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized/_actual-bundle-v2.js index 1f444ef704..7643ee066d 100644 --- a/test/js/samples/inline-style-optimized/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized/expected-bundle-v2.js b/test/js/samples/inline-style-optimized/expected-bundle-v2.js index 1f444ef704..7643ee066d 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 1f444ef704..7643ee066d 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js b/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js index 8ce9a079cd..67b2734743 100644 --- a/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js b/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js index 8ce9a079cd..67b2734743 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index 8ce9a079cd..67b2734743 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -69,8 +69,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index f81413a0fc..e881aa6de4 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -77,8 +77,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/legacy-default/expected-bundle.js b/test/js/samples/legacy-default/expected-bundle.js index 9c444e4097..d4c2199ca9 100644 --- a/test/js/samples/legacy-default/expected-bundle.js +++ b/test/js/samples/legacy-default/expected-bundle.js @@ -87,8 +87,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 67be768773..1119454b3d 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -71,8 +71,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index 4c44d15ccb..ffb11ab8f3 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -88,8 +88,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 2926e5a5a0..abcdd40986 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -81,8 +81,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index d6991d3b72..b4adec303a 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -67,8 +67,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index de7133b48c..0a91509619 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index 8267343f12..e1aaa9ae75 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 6d67ee7a1d..477d97c839 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/title/_actual-bundle-v2.js b/test/js/samples/title/_actual-bundle-v2.js index cc4b9229c8..27cae18b3d 100644 --- a/test/js/samples/title/_actual-bundle-v2.js +++ b/test/js/samples/title/_actual-bundle-v2.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/title/expected-bundle-v2.js b/test/js/samples/title/expected-bundle-v2.js index cc4b9229c8..27cae18b3d 100644 --- a/test/js/samples/title/expected-bundle-v2.js +++ b/test/js/samples/title/expected-bundle-v2.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index cc4b9229c8..27cae18b3d 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -53,8 +53,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js b/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js index 26852a5540..1fda063de1 100644 --- a/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js +++ b/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js @@ -77,8 +77,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js b/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js index 26852a5540..1fda063de1 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js @@ -77,8 +77,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 451a9fb9b6..f0eea45d77 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -77,8 +77,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/window-binding-scroll/_actual-bundle-v2.js b/test/js/samples/window-binding-scroll/_actual-bundle-v2.js index ef796382c4..deb99a4bb8 100644 --- a/test/js/samples/window-binding-scroll/_actual-bundle-v2.js +++ b/test/js/samples/window-binding-scroll/_actual-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/window-binding-scroll/expected-bundle-v2.js b/test/js/samples/window-binding-scroll/expected-bundle-v2.js index ef796382c4..deb99a4bb8 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle-v2.js +++ b/test/js/samples/window-binding-scroll/expected-bundle-v2.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler); diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index ef796382c4..deb99a4bb8 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -73,8 +73,6 @@ function init(component, options) { } function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); handlers.push(handler);