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 59cd2de125..33854eb0e6 100644
--- a/test/js/samples/collapses-text-around-comments/expected-bundle.js
+++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js
@@ -208,7 +208,7 @@ function add_css() {
appendNode(style, document.head);
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var p, text;
return {
@@ -247,7 +247,7 @@ function SvelteComponent(options) {
if (!document.getElementById("svelte-2794052100-style")) add_css();
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js
index aea4721e36..17e612b644 100644
--- a/test/js/samples/collapses-text-around-comments/expected.js
+++ b/test/js/samples/collapses-text-around-comments/expected.js
@@ -16,7 +16,7 @@ function add_css() {
appendNode(style, document.head);
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var p, text;
return {
@@ -55,7 +55,7 @@ function SvelteComponent(options) {
if (!document.getElementById("svelte-2794052100-style")) add_css();
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js
index 708ef5be95..5047d48b5e 100644
--- a/test/js/samples/component-static/expected-bundle.js
+++ b/test/js/samples/component-static/expected-bundle.js
@@ -171,7 +171,7 @@ var proto = {
/* generated by Svelte vX.Y.Z */
var Nested = window.Nested;
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var nested = new Nested({
root: component.root,
@@ -209,7 +209,7 @@ function SvelteComponent(options) {
this._aftercreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js
index d75cce1253..a689848dc0 100644
--- a/test/js/samples/component-static/expected.js
+++ b/test/js/samples/component-static/expected.js
@@ -3,7 +3,7 @@ import { assign, callAll, init, noop, proto } from "svelte/shared.js";
var Nested = window.Nested;
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var nested = new Nested({
root: component.root,
@@ -41,7 +41,7 @@ function SvelteComponent(options) {
this._aftercreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js
index b39f95a77b..64b09b4353 100644
--- a/test/js/samples/computed-collapsed-if/expected-bundle.js
+++ b/test/js/samples/computed-collapsed-if/expected-bundle.js
@@ -177,7 +177,7 @@ function b(x) {
return x * 3;
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -197,7 +197,7 @@ function SvelteComponent(options) {
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js
index c2f5e3c2be..e4a2fe00ef 100644
--- a/test/js/samples/computed-collapsed-if/expected.js
+++ b/test/js/samples/computed-collapsed-if/expected.js
@@ -9,7 +9,7 @@ function b(x) {
return x * 3;
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -29,7 +29,7 @@ function SvelteComponent(options) {
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js
index 91662053a4..66bb102184 100644
--- a/test/js/samples/css-media-query/expected-bundle.js
+++ b/test/js/samples/css-media-query/expected-bundle.js
@@ -200,7 +200,7 @@ function add_css() {
appendNode(style, document.head);
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -233,7 +233,7 @@ function SvelteComponent(options) {
if (!document.getElementById("svelte-3905933315-style")) add_css();
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js
index 37afa6b42a..6e03ca0a0a 100644
--- a/test/js/samples/css-media-query/expected.js
+++ b/test/js/samples/css-media-query/expected.js
@@ -12,7 +12,7 @@ function add_css() {
appendNode(style, document.head);
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -45,7 +45,7 @@ function SvelteComponent(options) {
if (!document.getElementById("svelte-3905933315-style")) add_css();
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 03e5cef1e2..486c2d1d82 100644
--- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js
+++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js
@@ -181,7 +181,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -214,7 +214,7 @@ class SvelteComponent extends HTMLElement {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = ``;
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this._fragment.c();
this._fragment.m(this.shadowRoot, null);
diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js
index 496586e632..39dd83e5cb 100644
--- a/test/js/samples/css-shadow-dom-keyframes/expected.js
+++ b/test/js/samples/css-shadow-dom-keyframes/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -34,7 +34,7 @@ class SvelteComponent extends HTMLElement {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = ``;
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this._fragment.c();
this._fragment.m(this.shadowRoot, null);
diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js
index ba22542c4b..841aaf7111 100644
--- a/test/js/samples/deconflict-globals/expected-bundle.js
+++ b/test/js/samples/deconflict-globals/expected-bundle.js
@@ -179,7 +179,7 @@ function oncreate() {
alert(JSON.stringify(data()));
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -204,7 +204,7 @@ function SvelteComponent(options) {
this._oncreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js
index 8730f4e3c3..d740fe634d 100644
--- a/test/js/samples/deconflict-globals/expected.js
+++ b/test/js/samples/deconflict-globals/expected.js
@@ -11,7 +11,7 @@ function oncreate() {
alert(JSON.stringify(data()));
};
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -36,7 +36,7 @@ function SvelteComponent(options) {
this._oncreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js
index 2079e6607c..b6667c9c91 100644
--- a/test/js/samples/do-use-dataset/expected-bundle.js
+++ b/test/js/samples/do-use-dataset/expected-bundle.js
@@ -185,7 +185,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1;
return {
@@ -227,7 +227,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js
index 1ae7417469..27a335d0a6 100644
--- a/test/js/samples/do-use-dataset/expected.js
+++ b/test/js/samples/do-use-dataset/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1;
return {
@@ -43,7 +43,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 efcfcc8f30..643e302968 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
@@ -189,7 +189,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1;
return {
@@ -231,7 +231,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 03eef26ced..e9062d7ba1 100644
--- a/test/js/samples/dont-use-dataset-in-legacy/expected.js
+++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1;
return {
@@ -43,7 +43,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 cf43bbd130..5c9ef31f54 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
@@ -189,7 +189,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var svg, g, g_1;
return {
@@ -229,7 +229,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 b87f152298..9e541886bc 100644
--- a/test/js/samples/dont-use-dataset-in-svg/expected.js
+++ b/test/js/samples/dont-use-dataset-in-svg/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var svg, g, g_1;
return {
@@ -41,7 +41,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 e35826e354..f90627f266 100644
--- a/test/js/samples/each-block-changed-check/expected-bundle.js
+++ b/test/js/samples/each-block-changed-check/expected-bundle.js
@@ -201,7 +201,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var text, p, text_1;
var comments = state.comments;
@@ -209,7 +209,10 @@ function create_main_fragment(state, component) {
var each_blocks = [];
for (var i = 0; i < comments.length; i += 1) {
- each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
+ each_blocks[i] = create_each_block(component, assign({}, state, {
+ comment: comments[i],
+ i: i
+ }));
}
return {
@@ -238,10 +241,15 @@ function create_main_fragment(state, component) {
if (changed.comments || changed.elapsed || changed.time) {
for (var i = 0; i < comments.length; i += 1) {
+ var each_context = assign({}, state, {
+ comment: comments[i],
+ i: i
+ });
+
if (each_blocks[i]) {
- each_blocks[i].p(changed, state, comments, comments[i], i);
+ each_blocks[i].p(changed, each_context);
} else {
- each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
+ each_blocks[i] = create_each_block(component, each_context);
each_blocks[i].c();
each_blocks[i].m(text.parentNode, text);
}
@@ -275,14 +283,14 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#each comments as comment, i}}
-function create_each_block(state, comments, comment, i, component) {
- var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
+function create_each_block(component, state) {
+ var div, strong, text, text_1, span, text_2_value = state.comment.author, text_2, text_3, text_4_value = state.elapsed(state.comment.time, state.time), text_4, text_5, text_6, raw_value = state.comment.html, raw_before;
return {
c: function create() {
div = createElement("div");
strong = createElement("strong");
- text = createText(i);
+ text = createText(state.i);
text_1 = createText("\n\n\t\t");
span = createElement("span");
text_2 = createText(text_2_value);
@@ -314,16 +322,16 @@ function create_each_block(state, comments, comment, i, component) {
raw_before.insertAdjacentHTML("afterend", raw_value);
},
- p: function update(changed, state, comments, comment, i) {
- if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
+ p: function update(changed, state) {
+ if ((changed.comments) && text_2_value !== (text_2_value = state.comment.author)) {
text_2.data = text_2_value;
}
- if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
+ if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(state.comment.time, state.time))) {
text_4.data = text_4_value;
}
- if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
+ if ((changed.comments) && raw_value !== (raw_value = state.comment.html)) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
@@ -343,7 +351,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js
index 29a57322e0..414fcb3f06 100644
--- a/test/js/samples/each-block-changed-check/expected.js
+++ b/test/js/samples/each-block-changed-check/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var text, p, text_1;
var comments = state.comments;
@@ -9,7 +9,10 @@ function create_main_fragment(state, component) {
var each_blocks = [];
for (var i = 0; i < comments.length; i += 1) {
- each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
+ each_blocks[i] = create_each_block(component, assign({}, state, {
+ comment: comments[i],
+ i: i
+ }));
}
return {
@@ -38,10 +41,15 @@ function create_main_fragment(state, component) {
if (changed.comments || changed.elapsed || changed.time) {
for (var i = 0; i < comments.length; i += 1) {
+ var each_context = assign({}, state, {
+ comment: comments[i],
+ i: i
+ });
+
if (each_blocks[i]) {
- each_blocks[i].p(changed, state, comments, comments[i], i);
+ each_blocks[i].p(changed, each_context);
} else {
- each_blocks[i] = create_each_block(state, comments, comments[i], i, component);
+ each_blocks[i] = create_each_block(component, each_context);
each_blocks[i].c();
each_blocks[i].m(text.parentNode, text);
}
@@ -75,14 +83,14 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#each comments as comment, i}}
-function create_each_block(state, comments, comment, i, component) {
- var div, strong, text, text_1, span, text_2_value = comment.author, text_2, text_3, text_4_value = state.elapsed(comment.time, state.time), text_4, text_5, text_6, raw_value = comment.html, raw_before;
+function create_each_block(component, state) {
+ var div, strong, text, text_1, span, text_2_value = state.comment.author, text_2, text_3, text_4_value = state.elapsed(state.comment.time, state.time), text_4, text_5, text_6, raw_value = state.comment.html, raw_before;
return {
c: function create() {
div = createElement("div");
strong = createElement("strong");
- text = createText(i);
+ text = createText(state.i);
text_1 = createText("\n\n\t\t");
span = createElement("span");
text_2 = createText(text_2_value);
@@ -114,16 +122,16 @@ function create_each_block(state, comments, comment, i, component) {
raw_before.insertAdjacentHTML("afterend", raw_value);
},
- p: function update(changed, state, comments, comment, i) {
- if ((changed.comments) && text_2_value !== (text_2_value = comment.author)) {
+ p: function update(changed, state) {
+ if ((changed.comments) && text_2_value !== (text_2_value = state.comment.author)) {
text_2.data = text_2_value;
}
- if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(comment.time, state.time))) {
+ if ((changed.elapsed || changed.comments || changed.time) && text_4_value !== (text_4_value = state.elapsed(state.comment.time, state.time))) {
text_4.data = text_4_value;
}
- if ((changed.comments) && raw_value !== (raw_value = comment.html)) {
+ if ((changed.comments) && raw_value !== (raw_value = state.comment.html)) {
detachAfter(raw_before);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
@@ -143,7 +151,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js
index 43db3035a3..252257d9e2 100644
--- a/test/js/samples/event-handlers-custom/expected-bundle.js
+++ b/test/js/samples/event-handlers-custom/expected-bundle.js
@@ -191,7 +191,7 @@ var methods = {
}
};
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var button, foo_handler;
return {
@@ -228,7 +228,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js
index f7862efb62..785fefbeef 100644
--- a/test/js/samples/event-handlers-custom/expected.js
+++ b/test/js/samples/event-handlers-custom/expected.js
@@ -11,7 +11,7 @@ var methods = {
}
};
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var button, foo_handler;
return {
@@ -48,7 +48,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js
index 91f894bc30..60a9e85bf0 100644
--- a/test/js/samples/head-no-whitespace/expected-bundle.js
+++ b/test/js/samples/head-no-whitespace/expected-bundle.js
@@ -181,7 +181,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var meta, meta_1;
return {
@@ -218,7 +218,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js
index 32a1a5da88..9ba161c69d 100644
--- a/test/js/samples/head-no-whitespace/expected.js
+++ b/test/js/samples/head-no-whitespace/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var meta, meta_1;
return {
@@ -38,7 +38,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 b309a25e96..6caf1e5853 100644
--- a/test/js/samples/if-block-no-update/expected-bundle.js
+++ b/test/js/samples/if-block-no-update/expected-bundle.js
@@ -185,11 +185,11 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var if_block_anchor;
var current_block_type = select_block_type(state);
- var if_block = current_block_type(state, component);
+ var if_block = current_block_type(component, state);
return {
c: function create() {
@@ -206,7 +206,7 @@ function create_main_fragment(state, component) {
if (current_block_type !== (current_block_type = select_block_type(state))) {
if_block.u();
if_block.d();
- if_block = current_block_type(state, component);
+ if_block = current_block_type(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
@@ -224,7 +224,7 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#if foo}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -246,7 +246,7 @@ function create_if_block(state, component) {
}
// (3:0) {{else}}
-function create_if_block_1(state, component) {
+function create_if_block_1(component, state) {
var p;
return {
@@ -276,7 +276,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js
index 8f030e4e53..a6e7f09d8d 100644
--- a/test/js/samples/if-block-no-update/expected.js
+++ b/test/js/samples/if-block-no-update/expected.js
@@ -1,11 +1,11 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var if_block_anchor;
var current_block_type = select_block_type(state);
- var if_block = current_block_type(state, component);
+ var if_block = current_block_type(component, state);
return {
c: function create() {
@@ -22,7 +22,7 @@ function create_main_fragment(state, component) {
if (current_block_type !== (current_block_type = select_block_type(state))) {
if_block.u();
if_block.d();
- if_block = current_block_type(state, component);
+ if_block = current_block_type(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
@@ -40,7 +40,7 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#if foo}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -62,7 +62,7 @@ function create_if_block(state, component) {
}
// (3:0) {{else}}
-function create_if_block_1(state, component) {
+function create_if_block_1(component, state) {
var p;
return {
@@ -92,7 +92,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js
index 5084639f4b..78b31ecb3d 100644
--- a/test/js/samples/if-block-simple/expected-bundle.js
+++ b/test/js/samples/if-block-simple/expected-bundle.js
@@ -185,10 +185,10 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var if_block_anchor;
- var if_block = (state.foo) && create_if_block(state, component);
+ var if_block = (state.foo) && create_if_block(component, state);
return {
c: function create() {
@@ -204,7 +204,7 @@ function create_main_fragment(state, component) {
p: function update(changed, state) {
if (state.foo) {
if (!if_block) {
- if_block = create_if_block(state, component);
+ if_block = create_if_block(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
@@ -227,7 +227,7 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#if foo}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -252,7 +252,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js
index 0b9fbece70..4c999546c0 100644
--- a/test/js/samples/if-block-simple/expected.js
+++ b/test/js/samples/if-block-simple/expected.js
@@ -1,10 +1,10 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var if_block_anchor;
- var if_block = (state.foo) && create_if_block(state, component);
+ var if_block = (state.foo) && create_if_block(component, state);
return {
c: function create() {
@@ -20,7 +20,7 @@ function create_main_fragment(state, component) {
p: function update(changed, state) {
if (state.foo) {
if (!if_block) {
- if_block = create_if_block(state, component);
+ if_block = create_if_block(component, state);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
@@ -43,7 +43,7 @@ function create_main_fragment(state, component) {
}
// (1:0) {{#if foo}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -68,7 +68,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 753d61db71..b40b46e4c5 100644
--- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js
+++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js
@@ -185,7 +185,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -225,7 +225,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js
index 77173460e2..ce3ffda243 100644
--- a/test/js/samples/inline-style-optimized-multiple/expected.js
+++ b/test/js/samples/inline-style-optimized-multiple/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -41,7 +41,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 cf360881b1..ce83c0473c 100644
--- a/test/js/samples/inline-style-optimized-url/expected-bundle.js
+++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js
@@ -185,7 +185,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -220,7 +220,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js
index bed00356f6..376cad092a 100644
--- a/test/js/samples/inline-style-optimized-url/expected.js
+++ b/test/js/samples/inline-style-optimized-url/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -36,7 +36,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js
index 38024df4ff..60d3574d4f 100644
--- a/test/js/samples/inline-style-optimized/expected-bundle.js
+++ b/test/js/samples/inline-style-optimized/expected-bundle.js
@@ -185,7 +185,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -220,7 +220,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js
index 7f873e296c..74c4b6f417 100644
--- a/test/js/samples/inline-style-optimized/expected.js
+++ b/test/js/samples/inline-style-optimized/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -36,7 +36,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js
index 320c733a43..368d9aeb15 100644
--- a/test/js/samples/inline-style-unoptimized/expected-bundle.js
+++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js
@@ -185,7 +185,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1, div_1_style_value;
return {
@@ -231,7 +231,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js
index 4c4d38d2bf..04e1226f6d 100644
--- a/test/js/samples/inline-style-unoptimized/expected.js
+++ b/test/js/samples/inline-style-unoptimized/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, div_1, div_1_style_value;
return {
@@ -47,7 +47,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 eacaca85a6..dcb3d2e061 100644
--- a/test/js/samples/input-without-blowback-guard/expected-bundle.js
+++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js
@@ -189,7 +189,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var input;
function input_change_handler() {
@@ -231,7 +231,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js
index 03f27ab6d9..d313c7c01d 100644
--- a/test/js/samples/input-without-blowback-guard/expected.js
+++ b/test/js/samples/input-without-blowback-guard/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var input;
function input_change_handler() {
@@ -43,7 +43,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js
index 7b730f08d9..b0174e2105 100644
--- a/test/js/samples/legacy-input-type/expected-bundle.js
+++ b/test/js/samples/legacy-input-type/expected-bundle.js
@@ -187,7 +187,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var input;
return {
@@ -218,7 +218,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js
index 719f550044..5236b758dc 100644
--- a/test/js/samples/legacy-input-type/expected.js
+++ b/test/js/samples/legacy-input-type/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var input;
return {
@@ -32,7 +32,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js
index 499a82c46e..3956acd874 100644
--- a/test/js/samples/legacy-quote-class/expected-bundle.js
+++ b/test/js/samples/legacy-quote-class/expected-bundle.js
@@ -204,7 +204,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -243,7 +243,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
var nodes = children(options.target);
diff --git a/test/js/samples/legacy-quote-class/expected.js b/test/js/samples/legacy-quote-class/expected.js
index 0b49103c47..76490fd6f9 100644
--- a/test/js/samples/legacy-quote-class/expected.js
+++ b/test/js/samples/legacy-quote-class/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div;
return {
@@ -40,7 +40,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
var nodes = children(options.target);
diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js
index bbd56d8123..75e852e835 100644
--- a/test/js/samples/media-bindings/expected-bundle.js
+++ b/test/js/samples/media-bindings/expected-bundle.js
@@ -197,7 +197,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
function audio_timeupdate_handler() {
@@ -289,7 +289,7 @@ function SvelteComponent(options) {
this._beforecreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js
index ae80f288f6..527e233cfd 100644
--- a/test/js/samples/media-bindings/expected.js
+++ b/test/js/samples/media-bindings/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
function audio_timeupdate_handler() {
@@ -93,7 +93,7 @@ function SvelteComponent(options) {
this._beforecreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js
index f8e0722db7..1b85f2f9d9 100644
--- a/test/js/samples/non-imported-component/expected-bundle.js
+++ b/test/js/samples/non-imported-component/expected-bundle.js
@@ -183,7 +183,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var text;
var imported = new Imported({
@@ -232,7 +232,7 @@ function SvelteComponent(options) {
this._aftercreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js
index e7fc2c7255..089e8db6e5 100644
--- a/test/js/samples/non-imported-component/expected.js
+++ b/test/js/samples/non-imported-component/expected.js
@@ -4,7 +4,7 @@ import Imported from 'Imported.html';
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var text;
var imported = new Imported({
@@ -53,7 +53,7 @@ function SvelteComponent(options) {
this._aftercreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js
index e53dd0de5e..9f59cc8a9a 100644
--- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js
+++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js
@@ -173,7 +173,7 @@ function oncreate() {}
function ondestroy() {}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -200,7 +200,7 @@ function SvelteComponent(options) {
this._oncreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
diff --git a/test/js/samples/onrender-onteardown-rewritten/expected.js b/test/js/samples/onrender-onteardown-rewritten/expected.js
index 51763c0b00..83e8d6200f 100644
--- a/test/js/samples/onrender-onteardown-rewritten/expected.js
+++ b/test/js/samples/onrender-onteardown-rewritten/expected.js
@@ -5,7 +5,7 @@ function oncreate() {};
function ondestroy() {};
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -32,7 +32,7 @@ function SvelteComponent(options) {
this._oncreate = [];
}
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js
index 58ee3a67a0..988103bc32 100644
--- a/test/js/samples/setup-method/expected-bundle.js
+++ b/test/js/samples/setup-method/expected-bundle.js
@@ -185,7 +185,7 @@ function setup(Component) {
Component.prototype.foo( 'baz' );
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -204,7 +204,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js
index 092a32ed3b..e4778f5826 100644
--- a/test/js/samples/setup-method/expected.js
+++ b/test/js/samples/setup-method/expected.js
@@ -17,7 +17,7 @@ function setup(Component) {
Component.prototype.foo( 'baz' );
}
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
return {
c: noop,
@@ -36,7 +36,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js
index 12f06bcf92..2ded30910d 100644
--- a/test/js/samples/svg-title/expected-bundle.js
+++ b/test/js/samples/svg-title/expected-bundle.js
@@ -189,7 +189,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var svg, title, text;
return {
@@ -219,7 +219,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js
index 39ccf227c0..059d1d804d 100644
--- a/test/js/samples/svg-title/expected.js
+++ b/test/js/samples/svg-title/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var svg, title, text;
return {
@@ -31,7 +31,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js
index 6eb3471b5b..f52f89a71a 100644
--- a/test/js/samples/title/expected-bundle.js
+++ b/test/js/samples/title/expected-bundle.js
@@ -169,7 +169,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var title_value;
document.title = title_value = "a " + state.custom + " title";
@@ -195,7 +195,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js
index 6aa903d25e..d5546cd4c2 100644
--- a/test/js/samples/title/expected.js
+++ b/test/js/samples/title/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var title_value;
document.title = title_value = "a " + state.custom + " title";
@@ -27,7 +27,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
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 e2ee1e61fb..6ece6bffa7 100644
--- a/test/js/samples/use-elements-as-anchors/expected-bundle.js
+++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js
@@ -193,18 +193,18 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
- var if_block = (state.a) && create_if_block(state, component);
+ var if_block = (state.a) && create_if_block(component, state);
- var if_block_1 = (state.b) && create_if_block_1(state, component);
+ var if_block_1 = (state.b) && create_if_block_1(component, state);
- var if_block_2 = (state.c) && create_if_block_2(state, component);
+ var if_block_2 = (state.c) && create_if_block_2(component, state);
- var if_block_3 = (state.d) && create_if_block_3(state, component);
+ var if_block_3 = (state.d) && create_if_block_3(component, state);
- var if_block_4 = (state.e) && create_if_block_4(state, component);
+ var if_block_4 = (state.e) && create_if_block_4(component, state);
return {
c: function create() {
@@ -248,7 +248,7 @@ function create_main_fragment(state, component) {
p: function update(changed, state) {
if (state.a) {
if (!if_block) {
- if_block = create_if_block(state, component);
+ if_block = create_if_block(component, state);
if_block.c();
if_block.m(div, text);
}
@@ -260,7 +260,7 @@ function create_main_fragment(state, component) {
if (state.b) {
if (!if_block_1) {
- if_block_1 = create_if_block_1(state, component);
+ if_block_1 = create_if_block_1(component, state);
if_block_1.c();
if_block_1.m(div, text_3);
}
@@ -272,7 +272,7 @@ function create_main_fragment(state, component) {
if (state.c) {
if (!if_block_2) {
- if_block_2 = create_if_block_2(state, component);
+ if_block_2 = create_if_block_2(component, state);
if_block_2.c();
if_block_2.m(div, text_4);
}
@@ -284,7 +284,7 @@ function create_main_fragment(state, component) {
if (state.d) {
if (!if_block_3) {
- if_block_3 = create_if_block_3(state, component);
+ if_block_3 = create_if_block_3(component, state);
if_block_3.c();
if_block_3.m(div, null);
}
@@ -296,7 +296,7 @@ function create_main_fragment(state, component) {
if (state.e) {
if (!if_block_4) {
- if_block_4 = create_if_block_4(state, component);
+ if_block_4 = create_if_block_4(component, state);
if_block_4.c();
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
}
@@ -329,7 +329,7 @@ function create_main_fragment(state, component) {
}
// (2:1) {{#if a}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -351,7 +351,7 @@ function create_if_block(state, component) {
}
// (8:1) {{#if b}}
-function create_if_block_1(state, component) {
+function create_if_block_1(component, state) {
var p;
return {
@@ -373,7 +373,7 @@ function create_if_block_1(state, component) {
}
// (12:1) {{#if c}}
-function create_if_block_2(state, component) {
+function create_if_block_2(component, state) {
var p;
return {
@@ -395,7 +395,7 @@ function create_if_block_2(state, component) {
}
// (18:1) {{#if d}}
-function create_if_block_3(state, component) {
+function create_if_block_3(component, state) {
var p;
return {
@@ -417,7 +417,7 @@ function create_if_block_3(state, component) {
}
// (25:0) {{#if e}}
-function create_if_block_4(state, component) {
+function create_if_block_4(component, state) {
var p;
return {
@@ -442,7 +442,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js
index d2609c45b0..0ff85d63b0 100644
--- a/test/js/samples/use-elements-as-anchors/expected.js
+++ b/test/js/samples/use-elements-as-anchors/expected.js
@@ -1,18 +1,18 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
- var if_block = (state.a) && create_if_block(state, component);
+ var if_block = (state.a) && create_if_block(component, state);
- var if_block_1 = (state.b) && create_if_block_1(state, component);
+ var if_block_1 = (state.b) && create_if_block_1(component, state);
- var if_block_2 = (state.c) && create_if_block_2(state, component);
+ var if_block_2 = (state.c) && create_if_block_2(component, state);
- var if_block_3 = (state.d) && create_if_block_3(state, component);
+ var if_block_3 = (state.d) && create_if_block_3(component, state);
- var if_block_4 = (state.e) && create_if_block_4(state, component);
+ var if_block_4 = (state.e) && create_if_block_4(component, state);
return {
c: function create() {
@@ -56,7 +56,7 @@ function create_main_fragment(state, component) {
p: function update(changed, state) {
if (state.a) {
if (!if_block) {
- if_block = create_if_block(state, component);
+ if_block = create_if_block(component, state);
if_block.c();
if_block.m(div, text);
}
@@ -68,7 +68,7 @@ function create_main_fragment(state, component) {
if (state.b) {
if (!if_block_1) {
- if_block_1 = create_if_block_1(state, component);
+ if_block_1 = create_if_block_1(component, state);
if_block_1.c();
if_block_1.m(div, text_3);
}
@@ -80,7 +80,7 @@ function create_main_fragment(state, component) {
if (state.c) {
if (!if_block_2) {
- if_block_2 = create_if_block_2(state, component);
+ if_block_2 = create_if_block_2(component, state);
if_block_2.c();
if_block_2.m(div, text_4);
}
@@ -92,7 +92,7 @@ function create_main_fragment(state, component) {
if (state.d) {
if (!if_block_3) {
- if_block_3 = create_if_block_3(state, component);
+ if_block_3 = create_if_block_3(component, state);
if_block_3.c();
if_block_3.m(div, null);
}
@@ -104,7 +104,7 @@ function create_main_fragment(state, component) {
if (state.e) {
if (!if_block_4) {
- if_block_4 = create_if_block_4(state, component);
+ if_block_4 = create_if_block_4(component, state);
if_block_4.c();
if_block_4.m(if_block_4_anchor.parentNode, if_block_4_anchor);
}
@@ -137,7 +137,7 @@ function create_main_fragment(state, component) {
}
// (2:1) {{#if a}}
-function create_if_block(state, component) {
+function create_if_block(component, state) {
var p;
return {
@@ -159,7 +159,7 @@ function create_if_block(state, component) {
}
// (8:1) {{#if b}}
-function create_if_block_1(state, component) {
+function create_if_block_1(component, state) {
var p;
return {
@@ -181,7 +181,7 @@ function create_if_block_1(state, component) {
}
// (12:1) {{#if c}}
-function create_if_block_2(state, component) {
+function create_if_block_2(component, state) {
var p;
return {
@@ -203,7 +203,7 @@ function create_if_block_2(state, component) {
}
// (18:1) {{#if d}}
-function create_if_block_3(state, component) {
+function create_if_block_3(component, state) {
var p;
return {
@@ -225,7 +225,7 @@ function create_if_block_3(state, component) {
}
// (25:0) {{#if e}}
-function create_if_block_4(state, component) {
+function create_if_block_4(component, state) {
var p;
return {
@@ -250,7 +250,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js
index a8a932c8b7..b310a6a839 100644
--- a/test/js/samples/window-binding-scroll/expected-bundle.js
+++ b/test/js/samples/window-binding-scroll/expected-bundle.js
@@ -189,7 +189,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
function onwindowscroll(event) {
@@ -244,7 +244,7 @@ function SvelteComponent(options) {
this._state = assign({}, options.data);
this._state.y = window.scrollY;
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js
index 70eae003d7..aa265f4599 100644
--- a/test/js/samples/window-binding-scroll/expected.js
+++ b/test/js/samples/window-binding-scroll/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, proto } from "svelte/shared.js";
-function create_main_fragment(state, component) {
+function create_main_fragment(component, state) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
function onwindowscroll(event) {
@@ -56,7 +56,7 @@ function SvelteComponent(options) {
this._state = assign({}, options.data);
this._state.y = window.scrollY;
- this._fragment = create_main_fragment(this._state, this);
+ this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();