|
|
@ -121,7 +121,7 @@ export default function dom(
|
|
|
|
const accessors = [];
|
|
|
|
const accessors = [];
|
|
|
|
|
|
|
|
|
|
|
|
const not_equal = component.component_options.immutable ? x`@not_equal` : x`@safe_not_equal`;
|
|
|
|
const not_equal = component.component_options.immutable ? x`@not_equal` : x`@safe_not_equal`;
|
|
|
|
let dev_props_check: Node[] | Node;
|
|
|
|
let missing_props_check: Node[] | Node;
|
|
|
|
let inject_state: Expression;
|
|
|
|
let inject_state: Expression;
|
|
|
|
let capture_state: Expression;
|
|
|
|
let capture_state: Expression;
|
|
|
|
let props_inject: Node[] | Node;
|
|
|
|
let props_inject: Node[] | Node;
|
|
|
@ -227,13 +227,13 @@ export default function dom(
|
|
|
|
const expected = props.filter(prop => prop.writable && !prop.initialised);
|
|
|
|
const expected = props.filter(prop => prop.writable && !prop.initialised);
|
|
|
|
|
|
|
|
|
|
|
|
if (expected.length) {
|
|
|
|
if (expected.length) {
|
|
|
|
dev_props_check = b`
|
|
|
|
missing_props_check = b`
|
|
|
|
const { ctx: #ctx } = this.$$;
|
|
|
|
$$self.$$.on_mount.push(function () {
|
|
|
|
const props = ${options.customElement ? x`this.attributes` : x`options.props || {}`};
|
|
|
|
|
|
|
|
${expected.map(prop => b`
|
|
|
|
${expected.map(prop => b`
|
|
|
|
if (${renderer.reference(prop.name)} === undefined && !('${prop.export_name}' in props)) {
|
|
|
|
if (${prop.name} === undefined && !(('${prop.export_name}' in $$props) || $$self.$$.bound[$$self.$$.props['${prop.export_name}']])) {
|
|
|
|
@_console.warn("<${component.tag}> was created without expected prop '${prop.export_name}'");
|
|
|
|
@_console.warn("<${component.tag}> was created without expected prop '${prop.export_name}'");
|
|
|
|
}`)}
|
|
|
|
}`)}
|
|
|
|
|
|
|
|
});
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -476,6 +476,7 @@ export default function dom(
|
|
|
|
|
|
|
|
|
|
|
|
${instance_javascript}
|
|
|
|
${instance_javascript}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
${missing_props_check}
|
|
|
|
${unknown_props_check}
|
|
|
|
${unknown_props_check}
|
|
|
|
|
|
|
|
|
|
|
|
${renderer.binding_groups.size > 0 && b`const $$binding_groups = [${[...renderer.binding_groups.keys()].map(_ => x`[]`)}];`}
|
|
|
|
${renderer.binding_groups.size > 0 && b`const $$binding_groups = [${[...renderer.binding_groups.keys()].map(_ => x`[]`)}];`}
|
|
|
@ -533,8 +534,6 @@ export default function dom(
|
|
|
|
|
|
|
|
|
|
|
|
@init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty});
|
|
|
|
@init(this, { target: this.shadowRoot, props: ${init_props}, customElement: true }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, null, ${dirty});
|
|
|
|
|
|
|
|
|
|
|
|
${dev_props_check}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (options) {
|
|
|
|
if (options) {
|
|
|
|
if (options.target) {
|
|
|
|
if (options.target) {
|
|
|
|
@insert(options.target, this, options.anchor);
|
|
|
|
@insert(options.target, this, options.anchor);
|
|
|
@ -594,8 +593,6 @@ export default function dom(
|
|
|
|
super(${options.dev && 'options'});
|
|
|
|
super(${options.dev && 'options'});
|
|
|
|
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${optional_parameters});
|
|
|
|
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${optional_parameters});
|
|
|
|
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}
|
|
|
|
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}
|
|
|
|
|
|
|
|
|
|
|
|
${dev_props_check}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`[0] as ClassDeclaration;
|
|
|
|
`[0] as ClassDeclaration;
|
|
|
|