refix fixtures

pull/4419/head
swyx 6 years ago
parent 054453bdc5
commit 8e01d06db0

@ -377,12 +377,9 @@ export default class EachBlockWrapper extends Wrapper {
block.chunks.init.push(b` block.chunks.init.push(b`
const ${get_key} = #ctx => ${this.node.key.manipulate(block)}; const ${get_key} = #ctx => ${this.node.key.manipulate(block)};
${this.renderer.options.dev && ${this.renderer.options.dev && b`@validate_each_keys(#ctx, ${this.vars.each_block_value}, ${this.vars.get_each_context}, ${get_key});`}
b`@validate_each_keys(#ctx, ${this.vars.each_block_value}, ${this.vars.get_each_context}, ${get_key});`}
for (let #i = 0; #i < ${data_length}; #i += 1) { for (let #i = 0; #i < ${data_length}; #i += 1) {
let child_ctx = ${this.vars.get_each_context}(#ctx, ${ let child_ctx = ${this.vars.get_each_context}(#ctx, ${this.vars.each_block_value}, #i);
this.vars.each_block_value
}, #i);
let key = ${get_key}(child_ctx); let key = ${get_key}(child_ctx);
${lookup}.set(key, ${iterations}[#i] = ${create_each_block}(key, child_ctx)); ${lookup}.set(key, ${iterations}[#i] = ${create_each_block}(key, child_ctx));
} }

@ -55,11 +55,7 @@ function create_each_block(ctx) {
insert_dev(target, t1, anchor); insert_dev(target, t1, anchor);
}, },
p: function update(ctx, dirty) { p: function update(ctx, dirty) {
if ( if (dirty & /*things*/ 1 && t0_value !== (t0_value = /*thing*/ ctx[4].name + "")) set_data_dev(t0, t0_value);
dirty & /*things*/ 1 &&
t0_value !== (t0_value = /*thing*/ ctx[4].name + "")
)
set_data_dev(t0, t0_value);
if (dirty & /*foo, bar, baz, things*/ 15) { if (dirty & /*foo, bar, baz, things*/ 15) {
const foo = /*foo*/ ctx[1]; const foo = /*foo*/ ctx[1];
@ -113,9 +109,7 @@ function create_fragment(ctx) {
add_location(p, file, 12, 0, 182); add_location(p, file, 12, 0, 182);
}, },
l: function claim(nodes) { l: function claim(nodes) {
throw new Error( throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
);
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
@ -181,15 +175,14 @@ function instance($$self, $$props, $$invalidate) {
const writable_props = ["things", "foo", "bar", "baz"]; const writable_props = ["things", "foo", "bar", "baz"];
Object.keys($$props).forEach(key => { Object.keys($$props).forEach(key => {
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Component> was created with unknown prop '${key}'`);
console.warn(`<Component> was created with unknown prop '${key}'`);
}); });
$$self.$set = $$props => { $$self.$set = $$props => {
if ("things" in $$props) $$invalidate(0, (things = $$props.things)); if ("things" in $$props) $$invalidate(0, things = $$props.things);
if ("foo" in $$props) $$invalidate(1, (foo = $$props.foo)); if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
if ("bar" in $$props) $$invalidate(2, (bar = $$props.bar)); if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
if ("baz" in $$props) $$invalidate(3, (baz = $$props.baz)); if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
}; };
$$self.$capture_state = () => { $$self.$capture_state = () => {
@ -197,10 +190,10 @@ function instance($$self, $$props, $$invalidate) {
}; };
$$self.$inject_state = $$props => { $$self.$inject_state = $$props => {
if ("things" in $$props) $$invalidate(0, (things = $$props.things)); if ("things" in $$props) $$invalidate(0, things = $$props.things);
if ("foo" in $$props) $$invalidate(1, (foo = $$props.foo)); if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
if ("bar" in $$props) $$invalidate(2, (bar = $$props.bar)); if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
if ("baz" in $$props) $$invalidate(3, (baz = $$props.baz)); if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
}; };
return [things, foo, bar, baz]; return [things, foo, bar, baz];
@ -209,12 +202,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponentDev { class Component extends SvelteComponentDev {
constructor(options) { constructor(options) {
super(options); super(options);
init(this, options, instance, create_fragment, safe_not_equal, { init(this, options, instance, create_fragment, safe_not_equal, { things: 0, foo: 1, bar: 2, baz: 3 });
things: 0,
foo: 1,
bar: 2,
baz: 3
});
dispatch_dev("SvelteRegisterComponent", { dispatch_dev("SvelteRegisterComponent", {
component: this, component: this,
@ -244,52 +232,36 @@ class Component extends SvelteComponentDev {
} }
get things() { get things() {
throw new Error( throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
set things(value) { set things(value) {
throw new Error( throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
get foo() { get foo() {
throw new Error( throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
set foo(value) { set foo(value) {
throw new Error( throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
get bar() { get bar() {
throw new Error( throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
set bar(value) { set bar(value) {
throw new Error( throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
get baz() { get baz() {
throw new Error( throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
set baz(value) { set baz(value) {
throw new Error( throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
"<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'"
);
} }
} }
export default Component; export default Component;

@ -81,9 +81,7 @@ function create_fragment(ctx) {
each_1_anchor = empty(); each_1_anchor = empty();
}, },
l: function claim(nodes) { l: function claim(nodes) {
throw new Error( throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
"options.hydrate only works if the component was compiled with the `hydratable: true` option"
);
}, },
m: function mount(target, anchor) { m: function mount(target, anchor) {
for (let i = 0; i < each_blocks.length; i += 1) { for (let i = 0; i < each_blocks.length; i += 1) {
@ -149,4 +147,4 @@ class Component extends SvelteComponentDev {
} }
} }
export default Component; export default Component;
Loading…
Cancel
Save