From 8a3898c6cb8caed13fbc474ecccdde5152eeefe4 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 13 Dec 2017 21:05:59 -0500 Subject: [PATCH] fix unrelated bug that was causing tests to fail --- mocha.opts | 1 - src/shared/index.js | 2 +- .../samples/collapses-text-around-comments/expected-bundle.js | 2 +- test/js/samples/component-static/expected-bundle.js | 2 +- test/js/samples/computed-collapsed-if/expected-bundle.js | 2 +- test/js/samples/css-media-query/expected-bundle.js | 2 +- test/js/samples/css-shadow-dom-keyframes/expected-bundle.js | 2 +- test/js/samples/do-use-dataset/expected-bundle.js | 2 +- test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js | 2 +- test/js/samples/dont-use-dataset-in-svg/expected-bundle.js | 2 +- test/js/samples/each-block-changed-check/expected-bundle.js | 2 +- test/js/samples/event-handlers-custom/expected-bundle.js | 2 +- test/js/samples/if-block-no-update/expected-bundle.js | 2 +- test/js/samples/if-block-simple/expected-bundle.js | 2 +- .../samples/inline-style-optimized-multiple/expected-bundle.js | 2 +- test/js/samples/inline-style-optimized-url/expected-bundle.js | 2 +- test/js/samples/inline-style-optimized/expected-bundle.js | 2 +- test/js/samples/inline-style-unoptimized/expected-bundle.js | 2 +- test/js/samples/input-without-blowback-guard/expected-bundle.js | 2 +- test/js/samples/legacy-input-type/expected-bundle.js | 2 +- test/js/samples/legacy-quote-class/expected-bundle.js | 2 +- test/js/samples/media-bindings/expected-bundle.js | 2 +- test/js/samples/non-imported-component/expected-bundle.js | 2 +- .../js/samples/onrender-onteardown-rewritten/expected-bundle.js | 2 +- test/js/samples/setup-method/expected-bundle.js | 2 +- test/js/samples/use-elements-as-anchors/expected-bundle.js | 2 +- test/js/samples/window-binding-scroll/expected-bundle.js | 2 +- 27 files changed, 26 insertions(+), 27 deletions(-) diff --git a/mocha.opts b/mocha.opts index af6b17a845..427b029758 100644 --- a/mocha.opts +++ b/mocha.opts @@ -1,2 +1 @@ ---bail test/test.js \ No newline at end of file diff --git a/src/shared/index.js b/src/shared/index.js index 79b6f2cba9..7b40b83fd1 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -185,7 +185,7 @@ export function _mount(target, anchor) { } export function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } export function isPromise(value) { 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 c54a4508e7..2ee6c82601 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -175,7 +175,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 27d4a5d5df..d23b405f1d 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -151,7 +151,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 9129d64ebf..23707b5f16 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -151,7 +151,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 3eb06a7baa..bc693e2f2d 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -171,7 +171,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 a8a14c254a..603f5863a9 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -163,7 +163,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 1baf806a52..85dab5840e 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 3ebad459d3..311dea6e41 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 @@ -171,7 +171,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 ba9b37513c..0224b84960 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 @@ -171,7 +171,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 dae7830ecb..aafbea428f 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -183,7 +183,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index b1974ae869..e16aba0d72 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -163,7 +163,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 12822a4ed3..b32eaf63c6 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 0985260579..67ac2f101c 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 6260246cc0..4aeaf3aae3 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 921d377bf9..30825c658b 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index 8ddc55d215..b0e0866be8 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index c3ca9e6957..d340596cfb 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -167,7 +167,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 a7a7d25e0c..5c5de22702 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -171,7 +171,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 54a4c3c02d..8d01a80899 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -169,7 +169,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index c6f7bb8405..39bbeffb68 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -186,7 +186,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index bdac2a8f2a..e4dc509e5c 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -179,7 +179,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index fd201d65b3..eaed52eb17 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -165,7 +165,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index 364ee2901d..f8f6fffbcd 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -151,7 +151,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index df267db975..fdb044b0bf 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -151,7 +151,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { 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 272e039772..f68775b963 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -175,7 +175,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = { diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index 3a11deb1b6..95fcc2b6f8 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -171,7 +171,7 @@ function _mount(target, anchor) { } function _unmount() { - this._fragment.u(); + if (this._fragment) this._fragment.u(); } var proto = {