You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/js/samples/debug-empty/expected.js

127 lines
2.9 KiB

5 years ago
/* generated by Svelte vX.Y.Z */
6 years ago
import {
SvelteComponentDev,
add_location,
6 years ago
append_dev,
detach_dev,
dispatch_dev,
6 years ago
element,
init,
6 years ago
insert_dev,
6 years ago
noop,
safe_not_equal,
6 years ago
set_data_dev,
space,
text,
validate_slots
6 years ago
} from "svelte/internal";
const file = undefined;
function create_fragment(ctx) {
let h1;
let t0;
let t1;
let t2;
let t3;
6 years ago
const block = {
c: function create() {
6 years ago
h1 = element("h1");
t0 = text("Hello ");
t1 = text(/*name*/ ctx[0]);
6 years ago
t2 = text("!");
t3 = space();
debugger;
6 years ago
add_location(h1, file, 4, 0, 38);
},
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) {
6 years ago
insert_dev(target, h1, anchor);
append_dev(h1, t0);
append_dev(h1, t1);
append_dev(h1, t2);
insert_dev(target, t3, anchor);
},
p: function update(ctx, [dirty]) {
if (dirty & /*name*/ 1) set_data_dev(t1, /*name*/ ctx[0]);
debugger;
},
i: noop,
o: noop,
6 years ago
d: function destroy(detaching) {
if (detaching) detach_dev(h1);
if (detaching) detach_dev(t3);
}
};
dispatch_dev("SvelteRegisterBlock", {
block,
id: create_fragment.name,
type: "component",
source: "",
ctx
});
6 years ago
return block;
}
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
validate_slots('Component', slots, []);
let { name } = $$props;
const writable_props = ['name'];
6 years ago
Object.keys($$props).forEach(key => {
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<Component> was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
if ('name' in $$props) $$invalidate(0, name = $$props.name);
};
$$self.$capture_state = () => ({ name });
5 years ago
$$self.$inject_state = $$props => {
if ('name' in $$props) $$invalidate(0, name = $$props.name);
6 years ago
};
if ($$props && "$$inject" in $$props) {
$$self.$inject_state($$props.$$inject);
}
return [name];
}
class Component extends SvelteComponentDev {
constructor(options) {
super(options);
init(this, options, instance, create_fragment, safe_not_equal, { name: 0 });
dispatch_dev("SvelteRegisterComponent", {
component: this,
tagName: "Component",
options,
id: create_fragment.name
});
const { ctx } = this.$$;
const props = options.props || {};
if (/*name*/ ctx[0] === undefined && !('name' in props)) {
console.warn("<Component> was created without expected prop 'name'");
}
}
6 years ago
get name() {
throw new Error("<Component>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
6 years ago
}
set name(value) {
throw new Error("<Component>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
6 years ago
}
}
5 years ago
export default Component;