dont wrap ESM in IIFE

pull/7738/head
Rich Harris 8 years ago
parent 1934d82dd7
commit 14e1c20dee

@ -93,10 +93,8 @@ function es(
${importHelpers}
${importBlock}
export default (function() {
${code}
return ${name};
}());`;
export default ${name};`;
}
function amd(

@ -190,8 +190,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
data: function () {
return { foo: 42 }
@ -199,18 +198,18 @@ var _actual = (function() {
};
}());
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-3590263702", "");
}
}
function add_css() {
function add_css() {
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
}
}
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var p, text;
return {
@ -241,9 +240,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = assign(template.data(), options.data);
@ -255,10 +254,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
data: function () {
return { foo: 42 }
@ -10,18 +9,18 @@ export default (function() {
};
}());
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-3590263702", "");
}
}
function add_css() {
function add_css() {
var style = createElement("style");
style.id = 'svelte-3590263702-style';
style.textContent = "p[svelte-3590263702],[svelte-3590263702] p{color:red}";
appendNode(style, document.head);
}
}
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var p, text;
return {
@ -52,9 +51,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = assign(template.data(), options.data);
@ -66,8 +65,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -166,8 +166,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
components: {
Nested: window.Nested
@ -175,7 +174,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var nested = new template.components.Nested({
_root: component._root,
@ -201,9 +200,9 @@ var _actual = (function() {
nested.destroy(false);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -225,10 +224,8 @@ var _actual = (function() {
callAll(this._aftercreate);
this._lock = false;
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
components: {
Nested: window.Nested
@ -10,7 +9,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var nested = new template.components.Nested({
_root: component._root,
@ -36,9 +35,9 @@ export default (function() {
nested.destroy(false);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -60,8 +59,7 @@ export default (function() {
callAll(this._aftercreate);
this._lock = false;
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -166,8 +166,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
computed: {
a: x => x * 2,
@ -176,7 +175,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -189,9 +188,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._recompute({ x: 1 }, this._state);
@ -202,17 +201,15 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
}
};
return SvelteComponent;
}());
};
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, differs, init, noop, proto } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
computed: {
a: x => x * 2,
@ -11,7 +10,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -24,9 +23,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._recompute({ x: 1 }, this._state);
@ -37,15 +36,14 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
}
}
return SvelteComponent;
}());
}
export default SvelteComponent;

@ -186,19 +186,18 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", "");
}
}
function add_css() {
function add_css() {
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
}
}
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -223,9 +222,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -237,10 +236,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,19 +1,18 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
export default (function() {
function encapsulateStyles(node) {
function encapsulateStyles(node) {
setAttribute(node, "svelte-2363328337", "");
}
}
function add_css() {
function add_css() {
var style = createElement("style");
style.id = 'svelte-2363328337-style';
style.textContent = "@media(min-width: 1px){div[svelte-2363328337],[svelte-2363328337] div{color:red}}";
appendNode(style, document.head);
}
}
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -38,9 +37,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -52,8 +51,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -186,8 +186,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text;
return {
@ -209,9 +208,9 @@ var _actual = (function() {
destroy: noop
};
}
}
class SvelteComponent extends HTMLElement {
class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
@ -235,10 +234,10 @@ var _actual = (function() {
attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue });
}
}
}
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, {
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, {
_mount(target, anchor) {
target.insertBefore(this, anchor);
},
@ -246,8 +245,6 @@ var _actual = (function() {
_unmount() {
this.parentNode.removeChild(this);
}
});
return SvelteComponent;
}());
});
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text;
return {
@ -24,9 +23,9 @@ export default (function() {
destroy: noop
};
}
}
class SvelteComponent extends HTMLElement {
class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
@ -50,10 +49,10 @@ export default (function() {
attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue });
}
}
}
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, {
customElements.define("custom-element", SvelteComponent);
assign(SvelteComponent.prototype, proto, {
_mount(target, anchor) {
target.insertBefore(this, anchor);
},
@ -61,6 +60,5 @@ export default (function() {
_unmount() {
this.parentNode.removeChild(this);
}
});
return SvelteComponent;
}());
});
export default SvelteComponent;

@ -198,8 +198,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text, p, text_1;
var comments = state.comments;
@ -270,10 +269,10 @@ var _actual = (function() {
destroyEach(each_blocks);
}
};
}
}
// (1:0) {{#each comments as comment, i}}
function create_each_block(state, comments, comment, i, 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;
return {
@ -335,9 +334,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -347,10 +346,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text, p, text_1;
var comments = state.comments;
@ -73,10 +72,10 @@ export default (function() {
destroyEach(each_blocks);
}
};
}
}
// (1:0) {{#each comments as comment, i}}
function create_each_block(state, comments, comment, i, 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;
return {
@ -138,9 +137,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -150,8 +149,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -186,8 +186,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
methods: {
foo ( bar ) {
@ -202,7 +201,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var button, foo_handler, text;
return {
@ -234,9 +233,9 @@ var _actual = (function() {
foo_handler.teardown();
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -246,10 +245,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, template.methods, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
methods: {
foo ( bar ) {
@ -17,7 +16,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var button, foo_handler, text;
return {
@ -49,9 +48,9 @@ export default (function() {
foo_handler.teardown();
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -61,8 +60,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, template.methods, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, template.methods, proto);
export default SvelteComponent;

@ -190,8 +190,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor;
var current_block_type = select_block_type(state);
@ -227,10 +226,10 @@ var _actual = (function() {
if_block.destroy();
}
};
}
}
// (1:0) {{#if foo}}
function create_if_block(state, component) {
// (1:0) {{#if foo}}
function create_if_block(state, component) {
var p, text;
return {
@ -250,10 +249,10 @@ var _actual = (function() {
destroy: noop
};
}
}
// (3:0) {{else}}
function create_if_block_1(state, component) {
// (3:0) {{else}}
function create_if_block_1(state, component) {
var p, text;
return {
@ -273,14 +272,14 @@ var _actual = (function() {
destroy: noop
};
}
}
function select_block_type(state) {
function select_block_type(state) {
if (state.foo) return create_if_block;
return create_if_block_1;
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -290,10 +289,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor;
var current_block_type = select_block_type(state);
@ -38,10 +37,10 @@ export default (function() {
if_block.destroy();
}
};
}
}
// (1:0) {{#if foo}}
function create_if_block(state, component) {
// (1:0) {{#if foo}}
function create_if_block(state, component) {
var p, text;
return {
@ -61,10 +60,10 @@ export default (function() {
destroy: noop
};
}
}
// (3:0) {{else}}
function create_if_block_1(state, component) {
// (3:0) {{else}}
function create_if_block_1(state, component) {
var p, text;
return {
@ -84,14 +83,14 @@ export default (function() {
destroy: noop
};
}
}
function select_block_type(state) {
function select_block_type(state) {
if (state.foo) return create_if_block;
return create_if_block_1;
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -101,8 +100,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -190,8 +190,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor;
var if_block = (state.foo) && create_if_block(state, component);
@ -230,10 +229,10 @@ var _actual = (function() {
if (if_block) if_block.destroy();
}
};
}
}
// (1:0) {{#if foo}}
function create_if_block(state, component) {
// (1:0) {{#if foo}}
function create_if_block(state, component) {
var p, text;
return {
@ -253,9 +252,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -265,10 +264,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var if_block_anchor;
var if_block = (state.foo) && create_if_block(state, component);
@ -41,10 +40,10 @@ export default (function() {
if (if_block) if_block.destroy();
}
};
}
}
// (1:0) {{#if foo}}
function create_if_block(state, component) {
// (1:0) {{#if foo}}
function create_if_block(state, component) {
var p, text;
return {
@ -64,9 +63,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -76,8 +75,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -182,8 +182,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -217,9 +216,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -229,10 +228,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -36,9 +35,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -48,8 +47,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -182,8 +182,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -212,9 +211,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -224,10 +223,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -31,9 +30,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -43,8 +42,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -182,8 +182,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -212,9 +211,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -224,10 +223,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -31,9 +30,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -43,8 +42,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -182,8 +182,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value;
return {
@ -223,9 +222,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -235,10 +234,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value;
return {
@ -42,9 +41,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -54,8 +53,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -186,8 +186,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input;
function input_change_handler() {
@ -223,9 +222,9 @@ var _actual = (function() {
removeListener(input, "change", input_change_handler);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -235,10 +234,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input;
function input_change_handler() {
@ -38,9 +37,9 @@ export default (function() {
removeListener(input, "change", input_change_handler);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -50,8 +49,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -184,8 +184,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input;
return {
@ -210,9 +209,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -222,10 +221,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var input;
return {
@ -27,9 +26,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -39,8 +38,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -201,8 +201,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -235,9 +234,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -249,10 +248,8 @@ var _actual = (function() {
nodes.forEach(detachNode);
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div;
return {
@ -35,9 +34,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -49,8 +48,7 @@ export default (function() {
nodes.forEach(detachNode);
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -194,8 +194,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var audio, audio_updating = false, audio_animationframe, audio_paused_value = true;
function audio_progress_loadedmetadata_handler() {
@ -299,9 +298,9 @@ var _actual = (function() {
removeListener(audio, "play", audio_pause_handler);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -318,10 +317,8 @@ var _actual = (function() {
callAll(this._beforecreate);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var audio, audio_updating = false, audio_animationframe, audio_paused_value = true;
function audio_progress_loadedmetadata_handler() {
@ -106,9 +105,9 @@ export default (function() {
removeListener(audio, "play", audio_pause_handler);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -125,8 +124,7 @@ export default (function() {
callAll(this._beforecreate);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -180,8 +180,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
components: {
NonImported
@ -189,7 +188,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text;
var imported = new Imported({
@ -226,9 +225,9 @@ var _actual = (function() {
nonimported.destroy(false);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -250,10 +249,8 @@ var _actual = (function() {
callAll(this._aftercreate);
this._lock = false;
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -2,8 +2,7 @@
import { assign, callAll, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import Imported from 'Imported.html';
export default (function() {
var template = (function() {
var template = (function() {
return {
components: {
NonImported
@ -11,7 +10,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var text;
var imported = new Imported({
@ -48,9 +47,9 @@ export default (function() {
nonimported.destroy(false);
}
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -72,8 +71,7 @@ export default (function() {
callAll(this._aftercreate);
this._lock = false;
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -166,8 +166,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
// this test should be removed in v2
oncreate () {},
@ -175,7 +174,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -188,9 +187,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -212,10 +211,8 @@ var _actual = (function() {
callAll(this._oncreate);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
// this test should be removed in v2
oncreate () {},
@ -10,7 +9,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -23,9 +22,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -47,8 +46,7 @@ export default (function() {
callAll(this._oncreate);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -166,8 +166,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
var template = (function() {
var template = (function() {
return {
methods: {
foo ( bar ) {
@ -186,7 +185,7 @@ var _actual = (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -199,9 +198,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -211,12 +210,10 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, template.methods, proto);
assign(SvelteComponent.prototype, template.methods, proto);
template.setup(SvelteComponent);
return SvelteComponent;
}());
template.setup(SvelteComponent);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
export default (function() {
var template = (function() {
var template = (function() {
return {
methods: {
foo ( bar ) {
@ -21,7 +20,7 @@ export default (function() {
};
}());
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
return {
create: noop,
@ -34,9 +33,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -46,10 +45,9 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, template.methods, proto);
assign(SvelteComponent.prototype, template.methods, proto);
template.setup(SvelteComponent);
return SvelteComponent;
}());
template.setup(SvelteComponent);
export default SvelteComponent;

@ -190,8 +190,7 @@ var proto = {
};
/* generated by Svelte vX.Y.Z */
var _actual = (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor;
var if_block = (state.a) && create_if_block(state, component);
@ -326,10 +325,10 @@ var _actual = (function() {
if (if_block_4) if_block_4.destroy();
}
};
}
}
// (2:1) {{#if a}}
function create_if_block(state, component) {
// (2:1) {{#if a}}
function create_if_block(state, component) {
var p, text;
return {
@ -349,10 +348,10 @@ var _actual = (function() {
destroy: noop
};
}
}
// (8:1) {{#if b}}
function create_if_block_1(state, component) {
// (8:1) {{#if b}}
function create_if_block_1(state, component) {
var p, text;
return {
@ -372,10 +371,10 @@ var _actual = (function() {
destroy: noop
};
}
}
// (12:1) {{#if c}}
function create_if_block_2(state, component) {
// (12:1) {{#if c}}
function create_if_block_2(state, component) {
var p, text;
return {
@ -395,10 +394,10 @@ var _actual = (function() {
destroy: noop
};
}
}
// (18:1) {{#if d}}
function create_if_block_3(state, component) {
// (18:1) {{#if d}}
function create_if_block_3(state, component) {
var p, text;
return {
@ -418,10 +417,10 @@ var _actual = (function() {
destroy: noop
};
}
}
// (25:0) {{#if e}}
function create_if_block_4(state, component) {
// (25:0) {{#if e}}
function create_if_block_4(state, component) {
var p, text;
return {
@ -441,9 +440,9 @@ var _actual = (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -453,10 +452,8 @@ var _actual = (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default _actual;
export default SvelteComponent;

@ -1,8 +1,7 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
export default (function() {
function create_main_fragment(state, component) {
function create_main_fragment(state, component) {
var div, text, p, text_1, text_2, text_3, text_4, p_1, text_5, text_6, text_8, if_block_4_anchor;
var if_block = (state.a) && create_if_block(state, component);
@ -137,10 +136,10 @@ export default (function() {
if (if_block_4) if_block_4.destroy();
}
};
}
}
// (2:1) {{#if a}}
function create_if_block(state, component) {
// (2:1) {{#if a}}
function create_if_block(state, component) {
var p, text;
return {
@ -160,10 +159,10 @@ export default (function() {
destroy: noop
};
}
}
// (8:1) {{#if b}}
function create_if_block_1(state, component) {
// (8:1) {{#if b}}
function create_if_block_1(state, component) {
var p, text;
return {
@ -183,10 +182,10 @@ export default (function() {
destroy: noop
};
}
}
// (12:1) {{#if c}}
function create_if_block_2(state, component) {
// (12:1) {{#if c}}
function create_if_block_2(state, component) {
var p, text;
return {
@ -206,10 +205,10 @@ export default (function() {
destroy: noop
};
}
}
// (18:1) {{#if d}}
function create_if_block_3(state, component) {
// (18:1) {{#if d}}
function create_if_block_3(state, component) {
var p, text;
return {
@ -229,10 +228,10 @@ export default (function() {
destroy: noop
};
}
}
// (25:0) {{#if e}}
function create_if_block_4(state, component) {
// (25:0) {{#if e}}
function create_if_block_4(state, component) {
var p, text;
return {
@ -252,9 +251,9 @@ export default (function() {
destroy: noop
};
}
}
function SvelteComponent(options) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
@ -264,8 +263,7 @@ export default (function() {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
}
}
}
assign(SvelteComponent.prototype, proto);
return SvelteComponent;
}());
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;

@ -74,7 +74,7 @@ describe("runtime", () => {
const { code } = svelte.compile(source, compileOptions);
const startIndex = code.indexOf("function create_main_fragment"); // may change!
if (startIndex === -1) throw new Error("missing create_main_fragment");
const endIndex = code.lastIndexOf("return");
const endIndex = code.lastIndexOf("export default");
const es5 =
code.slice(0, startIndex).split('\n').map(x => spaces(x.length)).join('\n') +
code.slice(startIndex, endIndex);

Loading…
Cancel
Save