/
expected.js
126 lines (107 loc) · 2.82 KB
/
expected.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* generated by Svelte vX.Y.Z */
import {
SvelteComponentDev,
add_location,
append_dev,
detach_dev,
dispatch_dev,
element,
init,
insert_dev,
noop,
safe_not_equal,
set_data_dev,
space,
text
} from "svelte/internal";
const file = undefined;
function create_fragment(ctx) {
let p;
let t0_value = Math.max(0, ctx[0]) + "";
let t0;
let t1;
let t2;
const block = {
c: function create() {
p = element("p");
t0 = text(t0_value);
t1 = space();
t2 = text(ctx[1]);
add_location(p, file, 7, 0, 67);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) {
insert_dev(target, p, anchor);
append_dev(p, t0);
append_dev(p, t1);
append_dev(p, t2);
},
p: function update(ctx, changed) {
if (changed & 1 && t0_value !== (t0_value = Math.max(0, ctx[0]) + "")) set_data_dev(t0, t0_value);
if (changed & 2) set_data_dev(t2, ctx[1]);
},
i: noop,
o: noop,
d: function destroy(detaching) {
if (detaching) detach_dev(p);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_fragment.name,
type: "component",
source: "",
ctx
});
return block;
}
function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
let bar;
const writable_props = ["foo"];
Object.keys($$props).forEach(key => {
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
});
$$self.$set = $$props => {
if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
};
$$self.$capture_state = () => {
return { foo, bar };
};
$$self.$inject_state = $$props => {
if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
if ("bar" in $$props) $$invalidate(1, bar = $$props.bar);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & 1) {
$: $$invalidate(1, bar = foo * 2);
}
};
return [foo, bar];
}
class Component extends SvelteComponentDev {
constructor(options) {
super(options);
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
dispatch_dev("SvelteRegisterComponent", {
component: this,
tagName: "Component",
options,
id: create_fragment.name
});
const { ctx } = this.$$;
const props = options.props || ({});
if (ctx[0] === undefined && !("foo" in props)) {
console.warn("<Component> was created without expected prop 'foo'");
}
}
get foo() {
throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
set foo(value) {
throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
}
export default Component;