diff --git a/src/generators/dom/index.ts b/src/generators/dom/index.ts index 1d25c4bcfc..fdf5c89339 100644 --- a/src/generators/dom/index.ts +++ b/src/generators/dom/index.ts @@ -267,7 +267,7 @@ export default function dom( this._fragment.c(); this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor || null); + if (options.target) this._mount(options.target, options.anchor); ` : deindent` if (options.target) { ${generator.hydratable @@ -280,7 +280,7 @@ export default function dom( ${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`} this._fragment.c(); `} - this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(options.target, options.anchor || null); + this._mount(options.target, options.anchor); ${(generator.hasComponents || generator.hasComplexBindings || templateProperties.oncreate || generator.hasIntroTransitions) && deindent` ${generator.hasComponents && `this._lock = true;`} diff --git a/src/shared/index.js b/src/shared/index.js index d9d6475e64..fcc4369364 100644 --- a/src/shared/index.js +++ b/src/shared/index.js @@ -185,7 +185,7 @@ export function callAll(fns) { } export function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } export function _unmount() { 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 5a321c0311..c122117285 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -171,7 +171,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -252,7 +252,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 17e612b644..1b44fc3493 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -59,7 +59,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 047169075a..c7969997a6 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -151,7 +151,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -219,7 +219,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 647b068179..5a60d641c2 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 047169075a..c7969997a6 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -151,7 +151,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -219,7 +219,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index 647b068179..5a60d641c2 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 5798f22df2..ec0d4ddff4 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -215,7 +215,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index a689848dc0..2207d7a8e3 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 08d3d2fca9..c297a03460 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -203,7 +203,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index d87ef16f92..2398f4bdee 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -33,7 +33,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 51f7c56732..da3fbb3ef8 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -239,7 +239,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 6e03ca0a0a..942d330947 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -49,7 +49,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 9ed1bbcef8..45aa714ea2 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -159,7 +159,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -221,7 +221,7 @@ class SvelteComponent extends HTMLElement { this._fragment.c(); this._fragment.m(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor || null); + if (options.target) this._mount(options.target, options.anchor); } static get observedAttributes() { diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 39dd83e5cb..7682ec0a40 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -39,7 +39,7 @@ class SvelteComponent extends HTMLElement { this._fragment.c(); this._fragment.m(this.shadowRoot, null); - if (options.target) this._mount(options.target, options.anchor || null); + if (options.target) this._mount(options.target, options.anchor); } static get observedAttributes() { diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index e210ffe3ac..050af86e46 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -211,7 +211,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._oncreate); } diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index d740fe634d..8e00df8d4a 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._oncreate); } diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 229e4a3450..ea6c4c26c0 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -233,7 +233,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js index 27a335d0a6..b88636a606 100644 --- a/test/js/samples/do-use-dataset/expected.js +++ b/test/js/samples/do-use-dataset/expected.js @@ -47,7 +47,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 75ce562da6..b1a3d273fa 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 @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -237,7 +237,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected.js b/test/js/samples/dont-use-dataset-in-legacy/expected.js index e9062d7ba1..699da1270b 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js @@ -47,7 +47,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 6cd012d4b7..311366c776 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 @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -235,7 +235,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/dont-use-dataset-in-svg/expected.js b/test/js/samples/dont-use-dataset-in-svg/expected.js index 9e541886bc..4269367254 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 11916f82b4..59b104ef0e 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -179,7 +179,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -360,7 +360,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 2eb66567a6..f76e10d943 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -158,7 +158,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 25f4ea324a..eaf52c8c7d 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -159,7 +159,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -233,7 +233,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index 785fefbeef..ecc6f97855 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -52,7 +52,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index f3eec8c97b..fe4181879a 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -159,7 +159,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -224,7 +224,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index 9ba161c69d..9818f42116 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -42,7 +42,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 662f80f0aa..bccbabab70 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -281,7 +281,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index 31b4b0f7a4..8bcac42cab 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -95,7 +95,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 9298283711..684a5aa6f1 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -258,7 +258,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 4c999546c0..11d3ccbdc6 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -72,7 +72,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 682b3f0423..4df73d50d2 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -231,7 +231,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index ce3ffda243..7a94993b69 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -45,7 +45,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 38f088a8e7..ad89d07b5e 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -226,7 +226,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index 376cad092a..5a27ecfa49 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -40,7 +40,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index e875dfc740..b012a321bb 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -226,7 +226,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 74c4b6f417..86dabe8d21 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -40,7 +40,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index 77a78ca5c0..2d36273b6e 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -163,7 +163,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -237,7 +237,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 04e1226f6d..7d7e933c12 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -51,7 +51,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 64b1dd79ad..0b5089c08d 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -237,7 +237,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index d313c7c01d..307a26c53c 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -47,7 +47,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/legacy-default/expected-bundle.js b/test/js/samples/legacy-default/expected-bundle.js index ce2e08302b..534b9d6baa 100644 --- a/test/js/samples/legacy-default/expected-bundle.js +++ b/test/js/samples/legacy-default/expected-bundle.js @@ -181,7 +181,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -275,7 +275,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/legacy-default/expected.js b/test/js/samples/legacy-default/expected.js index 6c90bb8f13..64dc4121c0 100644 --- a/test/js/samples/legacy-default/expected.js +++ b/test/js/samples/legacy-default/expected.js @@ -71,7 +71,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index 69d4f501dc..5cc1296a4f 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -165,7 +165,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -224,7 +224,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index 5236b758dc..2426c06481 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -36,7 +36,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index acc11efb5c..4a20d61232 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -182,7 +182,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -251,7 +251,7 @@ function SvelteComponent(options) { var nodes = children(options.target); options.hydrate ? this._fragment.l(nodes) : this._fragment.c(); nodes.forEach(detachNode); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/legacy-quote-class/expected.js b/test/js/samples/legacy-quote-class/expected.js index 76490fd6f9..de50dfa5e7 100644 --- a/test/js/samples/legacy-quote-class/expected.js +++ b/test/js/samples/legacy-quote-class/expected.js @@ -46,7 +46,7 @@ function SvelteComponent(options) { var nodes = children(options.target); options.hydrate ? this._fragment.l(nodes) : this._fragment.c(); nodes.forEach(detachNode); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 552a17c725..8287902dff 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -175,7 +175,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -295,7 +295,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._beforecreate); } diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 527e233cfd..a395dd4385 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -97,7 +97,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._beforecreate); } diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 85a5f677a9..399e3d594d 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -161,7 +161,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -240,7 +240,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index 089e8db6e5..c1637b7cc4 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -57,7 +57,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); this._lock = true; callAll(this._beforecreate); diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index 09775d1f81..783831720b 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -206,7 +206,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._oncreate); } diff --git a/test/js/samples/onrender-onteardown-rewritten/expected.js b/test/js/samples/onrender-onteardown-rewritten/expected.js index 83e8d6200f..1d91737faa 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected.js @@ -38,7 +38,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); callAll(this._oncreate); } diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index c30f01edb1..b4465e2a6b 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -210,7 +210,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index e4778f5826..12dc0b2452 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -40,7 +40,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 2beb78a678..534d98b185 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -225,7 +225,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index 059d1d804d..3f7ea0b8e9 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -35,7 +35,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index c37f7cb20a..e1de24a335 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -147,7 +147,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -201,7 +201,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index d5546cd4c2..0e059bbb4c 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -31,7 +31,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } 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 8a4a7817a3..fbfb801019 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -171,7 +171,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -448,7 +448,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 0ff85d63b0..5f6f27c742 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -254,7 +254,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index cac144881d..0fca60a0f8 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -167,7 +167,7 @@ function callAll(fns) { } function _mount(target, anchor) { - this._fragment.m(target, anchor); + this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null); } function _unmount() { @@ -250,7 +250,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index 0c22523b61..59009aeb9b 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -60,7 +60,7 @@ function SvelteComponent(options) { if (options.target) { this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); + this._mount(options.target, options.anchor); } } diff --git a/test/runtime/samples/transition-js-nested-intro/Child.html b/test/runtime/samples/transition-js-nested-intro/Child.html new file mode 100644 index 0000000000..32a4b81152 --- /dev/null +++ b/test/runtime/samples/transition-js-nested-intro/Child.html @@ -0,0 +1,17 @@ +
+ + \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-intro/_config.js b/test/runtime/samples/transition-js-nested-intro/_config.js new file mode 100644 index 0000000000..9906be26d2 --- /dev/null +++ b/test/runtime/samples/transition-js-nested-intro/_config.js @@ -0,0 +1,21 @@ +export default { + test ( assert, component, target, window, raf ) { + component.set({ visible: true }); + const div = target.querySelector( 'div' ); + assert.equal( div.foo, 0 ); + + raf.tick( 50 ); + assert.equal( div.foo, 0 ); + + raf.tick( 100 ); + assert.equal( div.foo, 0.5 ); + + raf.tick( 125 ); + assert.equal( div.foo, 0.75 ); + + raf.tick( 150 ); + assert.equal( div.foo, 1 ); + + component.destroy(); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/transition-js-nested-intro/main.html b/test/runtime/samples/transition-js-nested-intro/main.html new file mode 100644 index 0000000000..c8bf70b0ae --- /dev/null +++ b/test/runtime/samples/transition-js-nested-intro/main.html @@ -0,0 +1,10 @@ +{{#if visible}} + delayed +{{/if}} + + \ No newline at end of file