more tests passing

pull/3539/head
Richard Harris 6 years ago
parent 8f2c657d2c
commit 51f2b1cd04

@ -8,7 +8,7 @@ import add_to_set from '../utils/add_to_set';
import { extract_names } from '../utils/scope'; import { extract_names } from '../utils/scope';
import { invalidate } from '../utils/invalidate'; import { invalidate } from '../utils/invalidate';
import Block from './Block'; import Block from './Block';
import { ClassDeclaration, FunctionExpression, Node } from 'estree'; import { ClassDeclaration, FunctionExpression, Node, LabeledStatement, Statement } from 'estree';
export default function dom( export default function dom(
component: Component, component: Component,
@ -332,11 +332,12 @@ export default function dom(
}); });
const condition = !uses_props && writable.length > 0 && (writable const condition = !uses_props && writable.length > 0 && (writable
.map(n => x`$$dirty.${n}`) .map(n => x`#changed.${n}`)
.reduce((lhs, rhs) => x`${lhs} || ${rhs}`)); .reduce((lhs, rhs) => x`${lhs} || ${rhs}`));
let statement = d.node; let statement = d.node; // TODO remove label (use d.node.body) if it's not referenced
if (condition) statement = b`if (${condition}) { ${statement} }`[0];
if (condition) statement = b`if (${condition}) { ${statement} }`[0] as Statement;
if (condition || uses_props) { if (condition || uses_props) {
reactive_declarations.push(statement); reactive_declarations.push(statement);
@ -418,7 +419,7 @@ export default function dom(
${injected.map(name => b`let ${name};`)} ${injected.map(name => b`let ${name};`)}
${reactive_declarations.length > 0 && b` ${reactive_declarations.length > 0 && b`
$$self.$$.update = ($$dirty = ${reactive_dependencies}) => { $$self.$$.update = (#changed = ${reactive_dependencies}) => {
${reactive_declarations} ${reactive_declarations}
}; };
`} `}

@ -123,8 +123,8 @@ export default class AttributeWrapper {
: b` : b`
if (${option}.__value === ${last}) { if (${option}.__value === ${last}) {
${option}.selected = true; ${option}.selected = true;
${'break'}; ${{ type: 'BreakStatement' }};
}`; // TODO the 'break' is gross, but it's unsyntactic otherwise... }`; // TODO the BreakStatement is gross, but it's unsyntactic otherwise...
updater = b` updater = b`
for (var ${i} = 0; ${i} < ${element.var}.options.length; ${i} += 1) { for (var ${i} = 0; ${i} < ${element.var}.options.length; ${i} += 1) {

@ -40,9 +40,10 @@ export default class StyleAttributeWrapper extends AttributeWrapper {
}) })
.reduce((lhs, rhs) => x`${lhs} + ${rhs}`) .reduce((lhs, rhs) => x`${lhs} + ${rhs}`)
if (prop.value.length === 1 || prop.value[0].type === 'Text') { // TODO is this necessary? style.setProperty always treats value as string, no?
value = x`"" + ${value}`; // if (prop.value.length === 1 || prop.value[0].type !== 'Text') {
} // value = x`"" + ${value}`;
// }
if (prop_dependencies.size) { if (prop_dependencies.size) {
let condition = changed(Array.from(prop_dependencies)); let condition = changed(Array.from(prop_dependencies));

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -20,40 +19,32 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
// (5:0) {#each createElement as node}
function create_each_block(ctx) { function create_each_block(ctx) {
var span, t_value = ctx.node + "", t; let span;
let t_value = ctx.node + "";
let t;
return { return {
c() { c() {
span = element("span"); span = element("span");
t = text(t_value); t = text(t_value);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, span, anchor); insert(target, span, anchor);
append(span, t); append(span, t);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.createElement) && t_value !== (t_value = ctx.node + "")) { if (changed.createElement && t_value !== (t_value = ctx.node + "")) set_data(t, t_value);
set_data(t, t_value);
}
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(span);
detach(span);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var each_1_anchor; let each_anchor;
let each_value = ctx.createElement; let each_value = ctx.createElement;
let each_blocks = []; let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) { for (let i = 0; i < each_value.length; i += 1) {
@ -66,22 +57,20 @@ function create_fragment(ctx) {
each_blocks[i].c(); each_blocks[i].c();
} }
each_1_anchor = empty(); each_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
} }
insert(target, each_1_anchor, anchor); insert(target, each_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.createElement) { if (changed.createElement) {
each_value = ctx.createElement; each_value = ctx.createElement;
let i; let i;
for (i = 0; i < each_value.length; i += 1) { for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context(ctx, each_value, i); const child_ctx = get_each_context(ctx, each_value, i);
@ -90,26 +79,22 @@ function create_fragment(ctx) {
} else { } else {
each_blocks[i] = create_each_block(child_ctx); each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c(); each_blocks[i].c();
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); each_blocks[i].m(each_anchor.parentNode, each_anchor);
} }
} }
for (; i < each_blocks.length; i += 1) { for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1); each_blocks[i].d(1);
} }
each_blocks.length = each_value.length; each_blocks.length = each_value.length;
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
destroy_each(each_blocks, detaching); destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) {
detach(each_1_anchor);
}
} }
}; };
} }
@ -118,7 +103,7 @@ function instance($$self, $$props, $$invalidate) {
let { createElement } = $$props; let { createElement } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('createElement' in $$props) $$invalidate('createElement', createElement = $$props.createElement); if ("createElement" in $$props) $$invalidate("createElement", createElement = $$props.createElement);
}; };
return { createElement }; return { createElement };

@ -1,10 +1,4 @@
/* generated by Svelte vX.Y.Z */ import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
import {
SvelteComponent,
init,
noop,
safe_not_equal
} from "svelte/internal";
import { onMount } from "svelte"; import { onMount } from "svelte";
function create_fragment(ctx) { function create_fragment(ctx) {
@ -19,14 +13,14 @@ function create_fragment(ctx) {
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { foo = 'bar' } = $$props; let { foo = "bar" } = $$props;
onMount(() => { onMount(() => {
alert(JSON.stringify(data())); alert(JSON.stringify(data()));
}); });
$$self.$set = $$props => { $$self.$set = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
return { foo }; return { foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponentDev, SvelteComponentDev,
add_location, add_location,
@ -18,7 +17,11 @@ import {
const file = undefined; const file = undefined;
function create_fragment(ctx) { function create_fragment(ctx) {
var p, t0_value = Math.max(0, ctx.foo) + "", t0, t1, t2; let p;
let t0_value = Math.max(0, ctx.foo) + "";
let t0;
let t1;
let t2;
const block = { const block = {
c: function create() { c: function create() {
@ -28,53 +31,48 @@ function create_fragment(ctx) {
t2 = text(ctx.bar); t2 = text(ctx.bar);
add_location(p, file, 7, 0, 67); add_location(p, file, 7, 0, 67);
}, },
l: function claim(nodes) { l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {
insert_dev(target, p, anchor); insert_dev(target, p, anchor);
append_dev(p, t0); append_dev(p, t0);
append_dev(p, t1); append_dev(p, t1);
append_dev(p, t2); append_dev(p, t2);
}, },
p: function update(changed, ctx) { p: function update(changed, ctx) {
if ((changed.foo) && t0_value !== (t0_value = Math.max(0, ctx.foo) + "")) { if (changed.foo && t0_value !== (t0_value = Math.max(0, ctx.foo) + "")) set_data_dev(t0, t0_value);
set_data_dev(t0, t0_value); if (changed.bar) set_data_dev(t2, ctx.bar);
}
if (changed.bar) {
set_data_dev(t2, ctx.bar);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d: function destroy(detaching) { d: function destroy(detaching) {
if (detaching) { if (detaching) detach_dev(p);
detach_dev(p);
}
} }
}; };
dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment.name, type: "component", source: "", ctx });
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_fragment.name,
type: "component",
source: "",
ctx
});
return block; return block;
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { foo } = $$props; let { foo } = $$props;
let bar; let bar;
const writable_props = ["foo"];
const writable_props = ['foo'];
Object.keys($$props).forEach(key => { Object.keys($$props).forEach(key => {
if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(`<Component> was created with unknown prop '${key}'`); if (!writable_props.includes(key) && !key.startsWith("$$")) console.warn(`<Component> was created with unknown prop '${key}'`);
}); });
$$self.$set = $$props => { $$self.$set = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
$$self.$capture_state = () => { $$self.$capture_state = () => {
@ -82,12 +80,14 @@ function instance($$self, $$props, $$invalidate) {
}; };
$$self.$inject_state = $$props => { $$self.$inject_state = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
if ('bar' in $$props) $$invalidate('bar', bar = $$props.bar); if ("bar" in $$props) $$invalidate("bar", bar = $$props.bar);
}; };
$$self.$$.update = ($$dirty = { foo: 1 }) => { $$self.$$.update = (changed = { foo: 1 }) => {
if ($$dirty.foo) { $$invalidate('bar', bar = foo * 2); } if (changed.foo) {
$: $$invalidate("bar", bar = foo * 2);
}
}; };
return { foo, bar }; return { foo, bar };
@ -97,11 +97,18 @@ class Component extends SvelteComponentDev {
constructor(options) { constructor(options) {
super(options); super(options);
init(this, options, instance, create_fragment, safe_not_equal, ["foo"]); init(this, options, instance, create_fragment, safe_not_equal, ["foo"]);
dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Component", options, id: create_fragment.name });
dispatch_dev("SvelteRegisterComponent", {
component: this,
tagName: "Component",
options,
id: create_fragment.name
});
const { ctx } = this.$$; const { ctx } = this.$$;
const props = options.props || {}; const props = options.props || ({});
if (ctx.foo === undefined && !('foo' in props)) {
if (ctx.foo === undefined && !("foo" in props)) {
console.warn("<Component> was created without expected prop 'foo'"); console.warn("<Component> was created without expected prop 'foo'");
} }
} }

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,27 +10,22 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var input, dispose; let input;
let dispose;
return { return {
c() { c() {
input = element("input"); input = element("input");
dispose = listen(input, "input", make_uppercase); dispose = listen(input, "input", make_uppercase);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(input);
detach(input);
}
dispose(); dispose();
} }
}; };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
destroy_component, destroy_component,
@ -12,34 +11,27 @@ import {
import LazyLoad from "./LazyLoad.svelte"; import LazyLoad from "./LazyLoad.svelte";
function create_fragment(ctx) { function create_fragment(ctx) {
var current; let current;
const lazyload = new LazyLoad({ props: { load: func } });
var lazyload = new LazyLoad({ props: { load: func } });
return { return {
c() { c() {
lazyload.$$.fragment.c(); lazyload.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
mount_component(lazyload, target, anchor); mount_component(lazyload, target, anchor);
current = true; current = true;
}, },
p: noop, p: noop,
i(local) { i(local) {
if (current) return; if (current) return;
transition_in(lazyload.$$.fragment, local); transition_in(lazyload.$$.fragment, local);
current = true; current = true;
}, },
o(local) { o(local) {
transition_out(lazyload.$$.fragment, local); transition_out(lazyload.$$.fragment, local);
current = false; current = false;
}, },
d(detaching) { d(detaching) {
destroy_component(lazyload, detaching); destroy_component(lazyload, detaching);
} }

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -20,40 +19,32 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
// (9:0) {#each [a, b, c, d, e] as num}
function create_each_block(ctx) { function create_each_block(ctx) {
var span, t_value = ctx.num + "", t; let span;
let t_value = ctx.num + "";
let t;
return { return {
c() { c() {
span = element("span"); span = element("span");
t = text(t_value); t = text(t_value);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, span, anchor); insert(target, span, anchor);
append(span, t); append(span, t);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.a || changed.b || changed.c || changed.d || changed.e) && t_value !== (t_value = ctx.num + "")) { if ((changed.a || changed.b || changed.c || changed.d || changed.e) && t_value !== (t_value = ctx.num + "")) set_data(t, t_value);
set_data(t, t_value);
}
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(span);
detach(span);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var each_1_anchor; let each_anchor;
let each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e]; let each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e];
let each_blocks = []; let each_blocks = [];
for (let i = 0; i < 5; i += 1) { for (let i = 0; i < 5; i += 1) {
@ -66,23 +57,21 @@ function create_fragment(ctx) {
each_blocks[i].c(); each_blocks[i].c();
} }
each_1_anchor = empty(); each_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
for (let i = 0; i < 5; i += 1) { for (let i = 0; i < 5; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
} }
insert(target, each_1_anchor, anchor); insert(target, each_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.a || changed.b || changed.c || changed.d || changed.e) { if (changed.a || changed.b || changed.c || changed.d || changed.e) {
each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e]; each_value = [ctx.a, ctx.b, ctx.c, ctx.d, ctx.e];
let i; let i;
for (i = 0; i < each_value.length; i += 1) {
for (i = 0; i < 5; i += 1) {
const child_ctx = get_each_context(ctx, each_value, i); const child_ctx = get_each_context(ctx, each_value, i);
if (each_blocks[i]) { if (each_blocks[i]) {
@ -90,7 +79,7 @@ function create_fragment(ctx) {
} else { } else {
each_blocks[i] = create_each_block(child_ctx); each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c(); each_blocks[i].c();
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); each_blocks[i].m(each_anchor.parentNode, each_anchor);
} }
} }
@ -99,29 +88,28 @@ function create_fragment(ctx) {
} }
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
destroy_each(each_blocks, detaching); destroy_each(each_blocks, detaching);
if (detaching) detach(each_anchor);
if (detaching) {
detach(each_1_anchor);
}
} }
}; };
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { a, b, c, d, e } = $$props; let { a } = $$props;
let { b } = $$props;
let { c } = $$props;
let { d } = $$props;
let { e } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('a' in $$props) $$invalidate('a', a = $$props.a); if ("a" in $$props) $$invalidate("a", a = $$props.a);
if ('b' in $$props) $$invalidate('b', b = $$props.b); if ("b" in $$props) $$invalidate("b", b = $$props.b);
if ('c' in $$props) $$invalidate('c', c = $$props.c); if ("c" in $$props) $$invalidate("c", c = $$props.c);
if ('d' in $$props) $$invalidate('d', d = $$props.d); if ("d" in $$props) $$invalidate("d", d = $$props.d);
if ('e' in $$props) $$invalidate('e', e = $$props.e); if ("e" in $$props) $$invalidate("e", e = $$props.e);
}; };
return { a, b, c, d, e }; return { a, b, c, d, e };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
HtmlTag, HtmlTag,
SvelteComponent, SvelteComponent,
@ -23,9 +22,21 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
// (8:0) {#each comments as comment, i}
function create_each_block(ctx) { function create_each_block(ctx) {
var div, strong, t0, t1, span, t2_value = ctx.comment.author + "", t2, t3, t4_value = ctx.elapsed(ctx.comment.time, ctx.time) + "", t4, t5, t6, html_tag, raw_value = ctx.comment.html + ""; let div;
let strong;
let t0;
let t1;
let span;
let t2_value = ctx.comment.author + "";
let t2;
let t3;
let t4_value = ctx.elapsed(ctx.comment.time, ctx.time) + "";
let t4;
let t5;
let t6;
let html_tag;
let raw_value = ctx.comment.html + "";
return { return {
c() { c() {
@ -43,7 +54,6 @@ function create_each_block(ctx) {
html_tag = new HtmlTag(raw_value, null); html_tag = new HtmlTag(raw_value, null);
attr(div, "class", "comment"); attr(div, "class", "comment");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
append(div, strong); append(div, strong);
@ -57,34 +67,22 @@ function create_each_block(ctx) {
append(div, t6); append(div, t6);
html_tag.m(div); html_tag.m(div);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.comments) && t2_value !== (t2_value = ctx.comment.author + "")) { if (changed.comments && t2_value !== (t2_value = ctx.comment.author + "")) set_data(t2, t2_value);
set_data(t2, t2_value); if ((changed.elapsed || changed.comments || changed.time) && t4_value !== (t4_value = ctx.elapsed(ctx.comment.time, ctx.time) + "")) set_data(t4, t4_value);
} if (changed.comments && raw_value !== (raw_value = ctx.comment.html + "")) html_tag.p(raw_value);
if ((changed.elapsed || changed.comments || changed.time) && t4_value !== (t4_value = ctx.elapsed(ctx.comment.time, ctx.time) + "")) {
set_data(t4, t4_value);
}
if ((changed.comments) && raw_value !== (raw_value = ctx.comment.html + "")) {
html_tag.p(raw_value);
}
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var t0, p, t1; let t0;
let p;
let t1;
let each_value = ctx.comments; let each_value = ctx.comments;
let each_blocks = []; let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) { for (let i = 0; i < each_value.length; i += 1) {
@ -101,7 +99,6 @@ function create_fragment(ctx) {
p = element("p"); p = element("p");
t1 = text(ctx.foo); t1 = text(ctx.foo);
}, },
m(target, anchor) { m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
@ -111,12 +108,11 @@ function create_fragment(ctx) {
insert(target, p, anchor); insert(target, p, anchor);
append(p, t1); append(p, t1);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.comments || changed.elapsed || changed.time) { if (changed.comments || changed.elapsed || changed.time) {
each_value = ctx.comments; each_value = ctx.comments;
let i; let i;
for (i = 0; i < each_value.length; i += 1) { for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context(ctx, each_value, i); const child_ctx = get_each_context(ctx, each_value, i);
@ -132,36 +128,33 @@ function create_fragment(ctx) {
for (; i < each_blocks.length; i += 1) { for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1); each_blocks[i].d(1);
} }
each_blocks.length = each_value.length; each_blocks.length = each_value.length;
} }
if (changed.foo) { if (changed.foo) set_data(t1, ctx.foo);
set_data(t1, ctx.foo);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
destroy_each(each_blocks, detaching); destroy_each(each_blocks, detaching);
if (detaching) detach(t0);
if (detaching) { if (detaching) detach(p);
detach(t0);
detach(p);
}
} }
}; };
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { comments, elapsed, time, foo } = $$props; let { comments } = $$props;
let { elapsed } = $$props;
let { time } = $$props;
let { foo } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('comments' in $$props) $$invalidate('comments', comments = $$props.comments); if ("comments" in $$props) $$invalidate("comments", comments = $$props.comments);
if ('elapsed' in $$props) $$invalidate('elapsed', elapsed = $$props.elapsed); if ("elapsed" in $$props) $$invalidate("elapsed", elapsed = $$props.elapsed);
if ('time' in $$props) $$invalidate('time', time = $$props.time); if ("time" in $$props) $$invalidate("time", time = $$props.time);
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
return { comments, elapsed, time, foo }; return { comments, elapsed, time, foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -23,65 +22,56 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
// (19:0) {#each things as thing (thing.id)}
function create_each_block(key_1, ctx) { function create_each_block(key_1, ctx) {
var div, t_value = ctx.thing.name + "", t, rect, stop_animation = noop; let div;
let t_value = ctx.thing.name + "";
let t;
let rect;
let stop_animation = noop;
return { return {
key: key_1, key: key_1,
first: null, first: null,
c() { c() {
div = element("div"); div = element("div");
t = text(t_value); t = text(t_value);
this.first = div; this.first = div;
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
append(div, t); append(div, t);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.things) && t_value !== (t_value = ctx.thing.name + "")) { if (changed.things && t_value !== (t_value = ctx.thing.name + "")) set_data(t, t_value);
set_data(t, t_value);
}
}, },
r() { r() {
rect = div.getBoundingClientRect(); rect = div.getBoundingClientRect();
}, },
f() { f() {
fix_position(div); fix_position(div);
stop_animation(); stop_animation();
}, },
a() { a() {
stop_animation(); stop_animation();
stop_animation = create_animation(div, rect, foo, {}); stop_animation = create_animation(div, rect, foo, {});
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var each_blocks = [], each_1_lookup = new Map(), each_1_anchor; let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_value = ctx.things; let each_value = ctx.things;
const get_key = ctx => ctx.thing.id; const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) { for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i); let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx); let key = get_key(child_ctx);
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx)); each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
} }
return { return {
@ -90,35 +80,29 @@ function create_fragment(ctx) {
each_blocks[i].c(); each_blocks[i].c();
} }
each_1_anchor = empty(); each_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
} }
insert(target, each_1_anchor, anchor); insert(target, each_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
const each_value = ctx.things; const each_value = ctx.things;
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r(); for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r();
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context); each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, fix_and_destroy_block, create_each_block, each_anchor, get_each_context);
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a(); for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a();
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].d(detaching); each_blocks[i].d(detaching);
} }
if (detaching) { if (detaching) detach(each_anchor);
detach(each_1_anchor);
}
} }
}; };
} }
@ -141,7 +125,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props; let { things } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('things' in $$props) $$invalidate('things', things = $$props.things); if ("things" in $$props) $$invalidate("things", things = $$props.things);
}; };
return { things }; return { things };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -21,51 +20,43 @@ function get_each_context(ctx, list, i) {
return child_ctx; return child_ctx;
} }
// (5:0) {#each things as thing (thing.id)}
function create_each_block(key_1, ctx) { function create_each_block(key_1, ctx) {
var div, t_value = ctx.thing.name + "", t; let div;
let t_value = ctx.thing.name + "";
let t;
return { return {
key: key_1, key: key_1,
first: null, first: null,
c() { c() {
div = element("div"); div = element("div");
t = text(t_value); t = text(t_value);
this.first = div; this.first = div;
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
append(div, t); append(div, t);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.things) && t_value !== (t_value = ctx.thing.name + "")) { if (changed.things && t_value !== (t_value = ctx.thing.name + "")) set_data(t, t_value);
set_data(t, t_value);
}
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var each_blocks = [], each_1_lookup = new Map(), each_1_anchor; let each_blocks = [];
let each_lookup = new Map();
let each_anchor;
let each_value = ctx.things; let each_value = ctx.things;
const get_key = ctx => ctx.thing.id; const get_key = ctx => ctx.thing.id;
for (let i = 0; i < each_value.length; i += 1) { for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i); let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx); let key = get_key(child_ctx);
each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx)); each_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx));
} }
return { return {
@ -74,33 +65,27 @@ function create_fragment(ctx) {
each_blocks[i].c(); each_blocks[i].c();
} }
each_1_anchor = empty(); each_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(target, anchor); each_blocks[i].m(target, anchor);
} }
insert(target, each_1_anchor, anchor); insert(target, each_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
const each_value = ctx.things; const each_value = ctx.things;
each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context); each_blocks = update_keyed_each(each_blocks, changed, get_key, 1, ctx, each_value, each_lookup, each_anchor.parentNode, destroy_block, create_each_block, each_anchor, get_each_context);
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].d(detaching); each_blocks[i].d(detaching);
} }
if (detaching) { if (detaching) detach(each_anchor);
detach(each_1_anchor);
}
} }
}; };
} }
@ -109,7 +94,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props; let { things } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('things' in $$props) $$invalidate('things', things = $$props.things); if ("things" in $$props) $$invalidate("things", things = $$props.things);
}; };
return { things }; return { things };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -12,7 +11,8 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var a, dispose; let a;
let dispose;
return { return {
c() { c() {
@ -21,26 +21,20 @@ function create_fragment(ctx) {
attr(a, "href", "https://example.com"); attr(a, "href", "https://example.com");
dispose = listen(a, "touchstart", touchstart_handler); dispose = listen(a, "touchstart", touchstart_handler);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, a, anchor); insert(target, a, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(a);
detach(a);
}
dispose(); dispose();
} }
}; };
} }
const touchstart_handler = (e) => e.preventDefault(); const touchstart_handler = e => e.preventDefault();
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -16,7 +15,13 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div, button0, t1, button1, t3, button2, dispose; let div;
let button0;
let t1;
let button1;
let t3;
let button2;
let dispose;
return { return {
c() { c() {
@ -36,7 +41,6 @@ function create_fragment(ctx) {
listen(div, "touchstart", handleTouchstart, { passive: true }) listen(div, "touchstart", handleTouchstart, { passive: true })
]; ];
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
append(div, button0); append(div, button0);
@ -45,27 +49,22 @@ function create_fragment(ctx) {
append(div, t3); append(div, t3);
append(div, button2); append(div, button2);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
run_all(dispose); run_all(dispose);
} }
}; };
} }
function handleTouchstart() { function handleTouchstart() {
// ...
} }
function handleClick() { function handleClick() {
// ...
} }
class Component extends SvelteComponent { class Component extends SvelteComponent {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -11,7 +10,8 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var meta0, meta1; let meta0;
let meta1;
return { return {
c() { c() {
@ -22,16 +22,13 @@ function create_fragment(ctx) {
attr(meta1, "name", "twitter:title"); attr(meta1, "name", "twitter:title");
attr(meta1, "content", "Svelte"); attr(meta1, "content", "Svelte");
}, },
m(target, anchor) { m(target, anchor) {
append(document.head, meta0); append(document.head, meta0);
append(document.head, meta1); append(document.head, meta1);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
detach(meta0); detach(meta0);
detach(meta1); detach(meta1);

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -12,34 +11,33 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var b, t_value = get_answer() + "", t; let b;
let t_value = get_answer() + "";
let t;
return { return {
c() { c() {
b = element("b"); b = element("b");
t = text(t_value); t = text(t_value);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, b, anchor); insert(target, b, anchor);
append(b, t); append(b, t);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(b);
detach(b);
}
} }
}; };
} }
const ANSWER = 42; const ANSWER = 42;
function get_answer() { return ANSWER; } function get_answer() {
return ANSWER;
}
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -12,34 +11,33 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var b, t_value = get_answer() + "", t; let b;
let t_value = get_answer() + "";
let t;
return { return {
c() { c() {
b = element("b"); b = element("b");
t = text(t_value); t = text(t_value);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, b, anchor); insert(target, b, anchor);
append(b, t); append(b, t);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(b);
detach(b);
}
} }
}; };
} }
let ANSWER = 42; let ANSWER = 42;
function get_answer() { return ANSWER; } function get_answer() {
return ANSWER;
}
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -11,63 +10,49 @@ import {
safe_not_equal safe_not_equal
} from "svelte/internal"; } from "svelte/internal";
// (7:0) {#if (item.divider && item.divider.includes(1))}
function create_if_block(ctx) { function create_if_block(ctx) {
var div; let div;
return { return {
c() { c() {
div = element("div"); div = element("div");
attr(div, "class", "divider"); attr(div, "class", "divider");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var show_if = (ctx.item.divider && ctx.item.divider.includes(1)), if_block_anchor; let show_if = ctx.item.divider && ctx.item.divider.includes(1);
let if_block_anchor;
var if_block = (show_if) && create_if_block(ctx); let if_block = show_if && create_if_block(ctx);
return { return {
c() { c() {
if (if_block) if_block.c(); if (if_block) if_block.c();
if_block_anchor = empty(); if_block_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
if (if_block) if_block.m(target, anchor); if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor); insert(target, if_block_anchor, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (if_block) if_block.d(detaching); if (if_block) if_block.d(detaching);
if (detaching) detach(if_block_anchor);
if (detaching) {
detach(if_block_anchor);
}
} }
}; };
} }
function instance($$self) { function instance($$self) {
let item = { let item = { divider: [1] };
divider: [1]
}
return { item }; return { item };
} }

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -10,72 +9,60 @@ import {
safe_not_equal safe_not_equal
} from "svelte/internal"; } from "svelte/internal";
// (7:0) {:else}
function create_else_block(ctx) { function create_else_block(ctx) {
var p; let p;
return { return {
c() { c() {
p = element("p"); p = element("p");
p.textContent = "not foo!"; p.textContent = "not foo!";
}, },
m(target, anchor) { m(target, anchor) {
insert(target, p, anchor); insert(target, p, anchor);
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(p);
detach(p);
}
} }
}; };
} }
// (5:0) {#if foo}
function create_if_block(ctx) { function create_if_block(ctx) {
var p; let p;
return { return {
c() { c() {
p = element("p"); p = element("p");
p.textContent = "foo!"; p.textContent = "foo!";
}, },
m(target, anchor) { m(target, anchor) {
insert(target, p, anchor); insert(target, p, anchor);
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(p);
detach(p);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var if_block_anchor; let if_block_anchor;
function select_block_type(changed, ctx) { function select_block_type(changed, ctx) {
if (ctx.foo) return create_if_block; if (ctx.foo) return create_if_block;
return create_else_block; return create_else_block;
} }
var current_block_type = select_block_type(null, ctx); let current_block_type = select_block_type(null, ctx);
var if_block = current_block_type(ctx); let if_block = current_block_type(ctx);
return { return {
c() { c() {
if_block.c(); if_block.c();
if_block_anchor = empty(); if_block_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
if_block.m(target, anchor); if_block.m(target, anchor);
insert(target, if_block_anchor, anchor); insert(target, if_block_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (current_block_type !== (current_block_type = select_block_type(changed, ctx))) { if (current_block_type !== (current_block_type = select_block_type(changed, ctx))) {
if_block.d(1); if_block.d(1);
@ -86,16 +73,11 @@ function create_fragment(ctx) {
} }
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if_block.d(detaching); if_block.d(detaching);
if (detaching) detach(if_block_anchor);
if (detaching) {
detach(if_block_anchor);
}
} }
}; };
} }
@ -104,7 +86,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props; let { foo } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
return { foo }; return { foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -10,66 +9,55 @@ import {
safe_not_equal safe_not_equal
} from "svelte/internal"; } from "svelte/internal";
// (5:0) {#if foo}
function create_if_block(ctx) { function create_if_block(ctx) {
var p; let p;
return { return {
c() { c() {
p = element("p"); p = element("p");
p.textContent = "foo!"; p.textContent = "foo!";
}, },
m(target, anchor) { m(target, anchor) {
insert(target, p, anchor); insert(target, p, anchor);
}, },
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(p);
detach(p);
}
} }
}; };
} }
function create_fragment(ctx) { function create_fragment(ctx) {
var if_block_anchor; let if_block_anchor;
let if_block = ctx.foo && create_if_block(ctx);
var if_block = (ctx.foo) && create_if_block(ctx);
return { return {
c() { c() {
if (if_block) if_block.c(); if (if_block) if_block.c();
if_block_anchor = empty(); if_block_anchor = empty();
}, },
m(target, anchor) { m(target, anchor) {
if (if_block) if_block.m(target, anchor); if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor); insert(target, if_block_anchor, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (ctx.foo) { if (ctx.foo) {
if (!if_block) { if (!if_block) {
if_block = create_if_block(ctx); if_block = create_if_block(ctx);
if_block.c(); if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor); if_block.m(if_block_anchor.parentNode, if_block_anchor);
} else {
} }
} else if (if_block) { } else if (if_block) {
if_block.d(1); if_block.d(1);
if_block = null; if_block = null;
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (if_block) if_block.d(detaching); if (if_block) if_block.d(detaching);
if (detaching) detach(if_block_anchor);
if (detaching) {
detach(if_block_anchor);
}
} }
}; };
} }
@ -78,7 +66,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props; let { foo } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
return { foo }; return { foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,7 +10,7 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div; let div;
return { return {
c() { c() {
@ -19,11 +18,9 @@ function create_fragment(ctx) {
set_style(div, "color", ctx.color); set_style(div, "color", ctx.color);
set_style(div, "transform", "translate(" + ctx.x + "px," + ctx.y + "px)"); set_style(div, "transform", "translate(" + ctx.x + "px," + ctx.y + "px)");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.color) { if (changed.color) {
set_style(div, "color", ctx.color); set_style(div, "color", ctx.color);
@ -33,25 +30,23 @@ function create_fragment(ctx) {
set_style(div, "transform", "translate(" + ctx.x + "px," + ctx.y + "px)"); set_style(div, "transform", "translate(" + ctx.x + "px," + ctx.y + "px)");
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { color, x, y } = $$props; let { color } = $$props;
let { x } = $$props;
let { y } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('color' in $$props) $$invalidate('color', color = $$props.color); if ("color" in $$props) $$invalidate("color", color = $$props.color);
if ('x' in $$props) $$invalidate('x', x = $$props.x); if ("x" in $$props) $$invalidate("x", x = $$props.x);
if ('y' in $$props) $$invalidate('y', y = $$props.y); if ("y" in $$props) $$invalidate("y", y = $$props.y);
}; };
return { color, x, y }; return { color, x, y };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,31 +10,25 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div; let div;
return { return {
c() { c() {
div = element("div"); div = element("div");
set_style(div, "background", "url(data:image/png;base64," + ctx.data + ")"); set_style(div, "background", "url(data:image/png;base64," + ctx.data + ")");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.data) { if (changed.data) {
set_style(div, "background", "url(data:image/png;base64," + ctx.data + ")"); set_style(div, "background", "url(data:image/png;base64," + ctx.data + ")");
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
@ -44,7 +37,7 @@ function instance($$self, $$props, $$invalidate) {
let { data } = $$props; let { data } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('data' in $$props) $$invalidate('data', data = $$props.data); if ("data" in $$props) $$invalidate("data", data = $$props.data);
}; };
return { data }; return { data };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,31 +10,25 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div; let div;
return { return {
c() { c() {
div = element("div"); div = element("div");
set_style(div, "color", ctx.color); set_style(div, "color", ctx.color);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.color) { if (changed.color) {
set_style(div, "color", ctx.color); set_style(div, "color", ctx.color);
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
@ -44,7 +37,7 @@ function instance($$self, $$props, $$invalidate) {
let { color } = $$props; let { color } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('color' in $$props) $$invalidate('color', color = $$props.color); if ("color" in $$props) $$invalidate("color", color = $$props.color);
}; };
return { color }; return { color };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -12,7 +11,10 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div0, t, div1, div1_style_value; let div0;
let t;
let div1;
let div1_style_value;
return { return {
c() { c() {
@ -20,45 +22,41 @@ function create_fragment(ctx) {
t = space(); t = space();
div1 = element("div"); div1 = element("div");
attr(div0, "style", ctx.style); attr(div0, "style", ctx.style);
attr(div1, "style", div1_style_value = "" + ctx.key + ": " + ctx.value); attr(div1, "style", div1_style_value = "" + (ctx.key + ": " + ctx.value));
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div0, anchor); insert(target, div0, anchor);
insert(target, t, anchor); insert(target, t, anchor);
insert(target, div1, anchor); insert(target, div1, anchor);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.style) { if (changed.style) {
attr(div0, "style", ctx.style); attr(div0, "style", ctx.style);
} }
if ((changed.key || changed.value) && div1_style_value !== (div1_style_value = "" + ctx.key + ": " + ctx.value)) { if ((changed.key || changed.value) && div1_style_value !== (div1_style_value = "" + (ctx.key + ": " + ctx.value))) {
attr(div1, "style", div1_style_value); attr(div1, "style", div1_style_value);
} }
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div0);
detach(div0); if (detaching) detach(t);
detach(t); if (detaching) detach(div1);
detach(div1);
}
} }
}; };
} }
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { style, key, value } = $$props; let { style } = $$props;
let { key } = $$props;
let { value } = $$props;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('style' in $$props) $$invalidate('style', style = $$props.style); if ("style" in $$props) $$invalidate("style", style = $$props.style);
if ('key' in $$props) $$invalidate('key', key = $$props.key); if ("key" in $$props) $$invalidate("key", key = $$props.key);
if ('value' in $$props) $$invalidate('value', value = $$props.value); if ("value" in $$props) $$invalidate("value", value = $$props.value);
}; };
return { style, key, value }; return { style, key, value };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,31 +10,26 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var div; let div;
return { return {
c() { c() {
div = element("div"); div = element("div");
set_style(div, "color", color); set_style(div, "color", color);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, div, anchor); insert(target, div, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(div);
detach(div);
}
} }
}; };
} }
let color = 'red'; let color = "red";
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -12,7 +11,8 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var input, dispose; let input;
let dispose;
return { return {
c() { c() {
@ -21,20 +21,14 @@ function create_fragment(ctx) {
input.multiple = true; input.multiple = true;
dispose = listen(input, "change", ctx.input_change_handler); dispose = listen(input, "change", ctx.input_change_handler);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(input);
detach(input);
}
dispose(); dispose();
} }
}; };
@ -45,11 +39,11 @@ function instance($$self, $$props, $$invalidate) {
function input_change_handler() { function input_change_handler() {
files = this.files; files = this.files;
$$invalidate('files', files); $$invalidate("files", files);
} }
$$self.$set = $$props => { $$self.$set = $$props => {
if ('files' in $$props) $$invalidate('files', files = $$props.files); if ("files" in $$props) $$invalidate("files", files = $$props.files);
}; };
return { files, input_change_handler }; return { files, input_change_handler };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -16,7 +15,11 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var form, input, t, button, dispose; let form;
let input;
let t;
let button;
let dispose;
return { return {
c() { c() {
@ -33,29 +36,22 @@ function create_fragment(ctx) {
listen(form, "submit", ctx.handleSubmit) listen(form, "submit", ctx.handleSubmit)
]; ];
}, },
m(target, anchor) { m(target, anchor) {
insert(target, form, anchor); insert(target, form, anchor);
append(form, input); append(form, input);
set_input_value(input, ctx.test); set_input_value(input, ctx.test);
append(form, t); append(form, t);
append(form, button); append(form, button);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.test && (input.value !== ctx.test)) set_input_value(input, ctx.test); if (changed.test && input.value !== ctx.test) {
set_input_value(input, ctx.test);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(form);
detach(form);
}
run_all(dispose); run_all(dispose);
} }
}; };
@ -66,15 +62,19 @@ function instance($$self, $$props, $$invalidate) {
function handleSubmit(event) { function handleSubmit(event) {
event.preventDefault(); event.preventDefault();
console.log('value', test); console.log("value", test);
} }
function input_input_handler() { function input_input_handler() {
test = this.value; test = this.value;
$$invalidate('test', test); $$invalidate("test", test);
} }
return { test, handleSubmit, input_input_handler }; return {
test,
handleSubmit,
input_input_handler
};
} }
class Component extends SvelteComponent { class Component extends SvelteComponent {

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -15,7 +14,8 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var input, dispose; let input;
let dispose;
return { return {
c() { c() {
@ -27,25 +27,19 @@ function create_fragment(ctx) {
listen(input, "input", ctx.input_change_input_handler) listen(input, "input", ctx.input_change_input_handler)
]; ];
}, },
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
set_input_value(input, ctx.value); set_input_value(input, ctx.value);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.value) set_input_value(input, ctx.value); if (changed.value) {
set_input_value(input, ctx.value);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(input);
detach(input);
}
run_all(dispose); run_all(dispose);
} }
}; };
@ -56,11 +50,11 @@ function instance($$self, $$props, $$invalidate) {
function input_change_input_handler() { function input_change_input_handler() {
value = to_number(this.value); value = to_number(this.value);
$$invalidate('value', value); $$invalidate("value", value);
} }
$$self.$set = $$props => { $$self.$set = $$props => {
if ('value' in $$props) $$invalidate('value', value = $$props.value); if ("value" in $$props) $$invalidate("value", value = $$props.value);
}; };
return { value, input_change_input_handler }; return { value, input_change_input_handler };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
attr, attr,
@ -12,7 +11,8 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var input, dispose; let input;
let dispose;
return { return {
c() { c() {
@ -20,25 +20,19 @@ function create_fragment(ctx) {
attr(input, "type", "checkbox"); attr(input, "type", "checkbox");
dispose = listen(input, "change", ctx.input_change_handler); dispose = listen(input, "change", ctx.input_change_handler);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
input.checked = ctx.foo; input.checked = ctx.foo;
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.foo) input.checked = ctx.foo; if (changed.foo) {
input.checked = ctx.foo;
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(input);
detach(input);
}
dispose(); dispose();
} }
}; };
@ -49,11 +43,11 @@ function instance($$self, $$props, $$invalidate) {
function input_change_handler() { function input_change_handler() {
foo = this.checked; foo = this.checked;
$$invalidate('foo', foo); $$invalidate("foo", foo);
} }
$$self.$set = $$props => { $$self.$set = $$props => {
if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); if ("foo" in $$props) $$invalidate("foo", foo = $$props.foo);
}; };
return { foo, input_change_handler }; return { foo, input_change_handler };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -15,7 +14,12 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var button, t1, p, t2, t3, dispose; let button;
let t1;
let p;
let t2;
let t3;
let dispose;
return { return {
c() { c() {
@ -27,7 +31,6 @@ function create_fragment(ctx) {
t3 = text(ctx.x); t3 = text(ctx.x);
dispose = listen(button, "click", ctx.foo); dispose = listen(button, "click", ctx.foo);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, button, anchor); insert(target, button, anchor);
insert(target, t1, anchor); insert(target, t1, anchor);
@ -35,23 +38,15 @@ function create_fragment(ctx) {
append(p, t2); append(p, t2);
append(p, t3); append(p, t3);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.x) { if (changed.x) set_data(t3, ctx.x);
set_data(t3, ctx.x);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(button);
detach(button); if (detaching) detach(t1);
detach(t1); if (detaching) detach(p);
detach(p);
}
dispose(); dispose();
} }
}; };
@ -61,7 +56,7 @@ function instance($$self, $$props, $$invalidate) {
let x = 0; let x = 0;
function foo() { function foo() {
if (true) $$invalidate('x', x += 1); if (true) $$invalidate("x", x += 1);
} }
return { x, foo }; return { x, foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -15,7 +14,13 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var button, t1, p, t2, t3_value = ctx.things.length + "", t3, dispose; let button;
let t1;
let p;
let t2;
let t3_value = ctx.things.length + "";
let t3;
let dispose;
return { return {
c() { c() {
@ -27,7 +32,6 @@ function create_fragment(ctx) {
t3 = text(t3_value); t3 = text(t3_value);
dispose = listen(button, "click", ctx.foo); dispose = listen(button, "click", ctx.foo);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, button, anchor); insert(target, button, anchor);
insert(target, t1, anchor); insert(target, t1, anchor);
@ -35,23 +39,15 @@ function create_fragment(ctx) {
append(p, t2); append(p, t2);
append(p, t3); append(p, t3);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.things) && t3_value !== (t3_value = ctx.things.length + "")) { if (changed.things && t3_value !== (t3_value = ctx.things.length + "")) set_data(t3, t3_value);
set_data(t3, t3_value);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(button);
detach(button); if (detaching) detach(t1);
detach(t1); if (detaching) detach(p);
detach(p);
}
dispose(); dispose();
} }
}; };
@ -62,7 +58,7 @@ function instance($$self, $$props, $$invalidate) {
function foo() { function foo() {
things.push(1); things.push(1);
$$invalidate('things', things); $$invalidate("things", things);
} }
return { things, foo }; return { things, foo };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -15,7 +14,12 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var button, t1, p, t2, t3, dispose; let button;
let t1;
let p;
let t2;
let t3;
let dispose;
return { return {
c() { c() {
@ -27,7 +31,6 @@ function create_fragment(ctx) {
t3 = text(ctx.x); t3 = text(ctx.x);
dispose = listen(button, "click", ctx.click_handler); dispose = listen(button, "click", ctx.click_handler);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, button, anchor); insert(target, button, anchor);
insert(target, t1, anchor); insert(target, t1, anchor);
@ -35,23 +38,15 @@ function create_fragment(ctx) {
append(p, t2); append(p, t2);
append(p, t3); append(p, t3);
}, },
p(changed, ctx) { p(changed, ctx) {
if (changed.x) { if (changed.x) set_data(t3, ctx.x);
set_data(t3, ctx.x);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(button);
detach(button); if (detaching) detach(t1);
detach(t1); if (detaching) detach(p);
detach(p);
}
dispose(); dispose();
} }
}; };
@ -61,7 +56,7 @@ function instance($$self, $$props, $$invalidate) {
let x = 0; let x = 0;
const click_handler = () => { const click_handler = () => {
if (true) $$invalidate('x', x += 1); if (true) $$invalidate("x", x += 1);
}; };
return { x, click_handler }; return { x, click_handler };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -15,7 +14,13 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var button, t1, p, t2, t3_value = ctx.things.length + "", t3, dispose; let button;
let t1;
let p;
let t2;
let t3_value = ctx.things.length + "";
let t3;
let dispose;
return { return {
c() { c() {
@ -27,7 +32,6 @@ function create_fragment(ctx) {
t3 = text(t3_value); t3 = text(t3_value);
dispose = listen(button, "click", ctx.click_handler); dispose = listen(button, "click", ctx.click_handler);
}, },
m(target, anchor) { m(target, anchor) {
insert(target, button, anchor); insert(target, button, anchor);
insert(target, t1, anchor); insert(target, t1, anchor);
@ -35,23 +39,15 @@ function create_fragment(ctx) {
append(p, t2); append(p, t2);
append(p, t3); append(p, t3);
}, },
p(changed, ctx) { p(changed, ctx) {
if ((changed.things) && t3_value !== (t3_value = ctx.things.length + "")) { if (changed.things && t3_value !== (t3_value = ctx.things.length + "")) set_data(t3, t3_value);
set_data(t3, t3_value);
}
}, },
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(button);
detach(button); if (detaching) detach(t1);
detach(t1); if (detaching) detach(p);
detach(p);
}
dispose(); dispose();
} }
}; };
@ -60,7 +56,10 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let things = []; let things = [];
const click_handler = () => { things.push(1); $$invalidate('things', things) }; const click_handler = () => {
things.push(1);
$$invalidate("things", things);
};
return { things, click_handler }; return { things, click_handler };
} }

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
detach, detach,
@ -11,26 +10,21 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var input; let input;
return { return {
c() { c() {
input = element("input"); input = element("input");
set_input_type(input, "search"); set_input_type(input, "search");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, input, anchor); insert(target, input, anchor);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(input);
detach(input);
}
} }
}; };
} }

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
destroy_component, destroy_component,
@ -15,11 +14,10 @@ import {
import Imported from "Imported.svelte"; import Imported from "Imported.svelte";
function create_fragment(ctx) { function create_fragment(ctx) {
var t, current; let t;
let current;
var imported = new Imported({}); const imported = new Imported({});
const nonimported = new NonImported({});
var nonimported = new NonImported({});
return { return {
c() { c() {
@ -27,38 +25,27 @@ function create_fragment(ctx) {
t = space(); t = space();
nonimported.$$.fragment.c(); nonimported.$$.fragment.c();
}, },
m(target, anchor) { m(target, anchor) {
mount_component(imported, target, anchor); mount_component(imported, target, anchor);
insert(target, t, anchor); insert(target, t, anchor);
mount_component(nonimported, target, anchor); mount_component(nonimported, target, anchor);
current = true; current = true;
}, },
p: noop, p: noop,
i(local) { i(local) {
if (current) return; if (current) return;
transition_in(imported.$$.fragment, local); transition_in(imported.$$.fragment, local);
transition_in(nonimported.$$.fragment, local); transition_in(nonimported.$$.fragment, local);
current = true; current = true;
}, },
o(local) { o(local) {
transition_out(imported.$$.fragment, local); transition_out(imported.$$.fragment, local);
transition_out(nonimported.$$.fragment, local); transition_out(nonimported.$$.fragment, local);
current = false; current = false;
}, },
d(detaching) { d(detaching) {
destroy_component(imported, detaching); destroy_component(imported, detaching);
if (detaching) detach(t);
if (detaching) {
detach(t);
}
destroy_component(nonimported, detaching); destroy_component(nonimported, detaching);
} }
}; };

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import { import {
SvelteComponent, SvelteComponent,
append, append,
@ -12,7 +11,10 @@ import {
} from "svelte/internal"; } from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
var h1, t0, t1, t2; let h1;
let t0;
let t1;
let t2;
return { return {
c() { c() {
@ -21,27 +23,22 @@ function create_fragment(ctx) {
t1 = text(name); t1 = text(name);
t2 = text("!"); t2 = text("!");
}, },
m(target, anchor) { m(target, anchor) {
insert(target, h1, anchor); insert(target, h1, anchor);
append(h1, t0); append(h1, t0);
append(h1, t1); append(h1, t1);
append(h1, t2); append(h1, t2);
}, },
p: noop, p: noop,
i: noop, i: noop,
o: noop, o: noop,
d(detaching) { d(detaching) {
if (detaching) { if (detaching) detach(h1);
detach(h1);
}
} }
}; };
} }
let name = 'world'; let name = "world";
class Component extends SvelteComponent { class Component extends SvelteComponent {
constructor(options) { constructor(options) {

@ -1,10 +1,4 @@
/* generated by Svelte vX.Y.Z */ import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
import {
SvelteComponent,
init,
noop,
safe_not_equal
} from "svelte/internal";
function create_fragment(ctx) { function create_fragment(ctx) {
return { return {
@ -19,17 +13,21 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) { function instance($$self, $$props, $$invalidate) {
let { x } = $$props; let { x } = $$props;
let a; let a;
let b; let b;
$$self.$set = $$props => { $$self.$set = $$props => {
if ('x' in $$props) $$invalidate('x', x = $$props.x); if ("x" in $$props) $$invalidate("x", x = $$props.x);
}; };
$$self.$$.update = ($$dirty = { x: 1, b: 1 }) => { $$self.$$.update = (changed = { x: 1, b: 1 }) => {
if ($$dirty.x) { $$invalidate('b', b = x); } if (changed.x) {
if ($$dirty.b) { a = b; } $: $$invalidate("b", b = x);
}
if (changed.b) {
$: a = b;
}
}; };
return { x }; return { x };

@ -20,9 +20,9 @@ function instance($$self, $$props, $$invalidate) {
if ("b" in $$props) $$invalidate("b", b = $$props.b); if ("b" in $$props) $$invalidate("b", b = $$props.b);
}; };
$$self.$$.update = ($$dirty = { a: 1, b: 1 }) => { $$self.$$.update = (changed = { a: 1, b: 1 }) => {
if ($$dirty.a || $$dirty.b) { if (changed.a || changed.b) {
console.log("max", Math.max(a, b)); $: console.log("max", Math.max(a, b));
} }
}; };

@ -56,13 +56,13 @@ function instance($$self, $$props, $$invalidate) {
let x; let x;
let y; let y;
$$self.$$.update = ($$dirty = { a: 1, b: 1 }) => { $$self.$$.update = (changed = { a: 1, b: 1 }) => {
if ($$dirty.a) { if (changed.a) {
x = a * 2; $: x = a * 2;
} }
if ($$dirty.b) { if (changed.b) {
$$invalidate("y", y = b * 2); $: $$invalidate("y", y = b * 2);
} }
}; };

Loading…
Cancel
Save