diff --git a/src/shared/index.js b/src/shared/index.js index 0d7cb43bdd..1040e5eb6b 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -13,11 +13,12 @@ export function blankObject() { export function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } export function destroyDev(detach) { diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index 093fb642a7..6c93a26fbb 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -24,11 +24,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 6786d1c2dc..6d3d9653a4 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 235f57755d..885c914ee4 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 235f57755d..885c914ee4 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index dc4f6dbf0d..3a076f7b06 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 8cd4bf0011..c4ee816672 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 6b1455f9c6..4a9ed1203e 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 c2f35f7b98..fe55d1c905 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -24,11 +24,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index 2f9dd2db1d..f26f231f4a 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -42,11 +42,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 214eed9578..5f02ccb9f3 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 e0ff6a1171..574211a6e0 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 @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function destroyDev(detach) { diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 32af7494c3..7e6d87e70d 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 5e9def1913..e7bd12a65e 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 @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 54b8382a2d..51c29449e7 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 @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 89c3cab243..fc21b6f747 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -44,11 +44,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 5d85e177e1..0cfb3a6cee 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -24,11 +24,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index 7f88574b70..f812b7f6e2 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -24,11 +24,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 1760a2ca60..3455491811 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index f71aafff94..3e1925e2ea 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 bd3bacfac2..77e36beceb 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 4119905682..2850b95305 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 7643ee066d..eade3769ee 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index 67b2734743..4b696f17af 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -28,11 +28,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 e881aa6de4..9101a81c6c 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -36,11 +36,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 1119454b3d..f07c5c914e 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -30,11 +30,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index abcdd40986..b2010075af 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -40,11 +40,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index b4adec303a..871f615eb9 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -26,11 +26,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index e1aaa9ae75..53edf878f8 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 477d97c839..5b9452eb77 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index 27cae18b3d..1403bdadcd 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -12,11 +12,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { 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 1fda063de1..5554270e8b 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -36,11 +36,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index df4fc6b2c9..704146c5a9 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -32,11 +32,12 @@ function blankObject() { function destroy(detach) { this.destroy = noop; this.fire('destroy'); - this.set = this.get = noop; + this.set = noop; if (detach !== false) this._fragment.u(); this._fragment.d(); - this._fragment = this._state = null; + this._fragment = null; + this._state = {}; } function _differs(a, b) { diff --git a/test/runtime/samples/get-after-destroy/_config.js b/test/runtime/samples/get-after-destroy/_config.js new file mode 100644 index 0000000000..c3627bc604 --- /dev/null +++ b/test/runtime/samples/get-after-destroy/_config.js @@ -0,0 +1,13 @@ +export default { + data: { + foo: 1 + }, + + html: `