|
|
@ -172,16 +172,21 @@ function validate_slot_attribute(context, attribute) {
|
|
|
|
error(attribute, 'invalid-slot-attribute');
|
|
|
|
error(attribute, 'invalid-slot-attribute');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (owner.type === 'Component' || owner.type === 'SvelteComponent') {
|
|
|
|
if (
|
|
|
|
|
|
|
|
owner.type === 'Component' ||
|
|
|
|
|
|
|
|
owner.type === 'SvelteComponent' ||
|
|
|
|
|
|
|
|
owner.type === 'SvelteSelf'
|
|
|
|
|
|
|
|
) {
|
|
|
|
if (owner !== context.path.at(-2)) {
|
|
|
|
if (owner !== context.path.at(-2)) {
|
|
|
|
error(attribute, 'invalid-slot-placement');
|
|
|
|
error(attribute, 'invalid-slot-placement');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const name = attribute.value[0].data;
|
|
|
|
const name = attribute.value[0].data;
|
|
|
|
|
|
|
|
|
|
|
|
if (context.state.component_slots.has(name)) {
|
|
|
|
if (context.state.component_slots.has(name)) {
|
|
|
|
error(attribute, 'duplicate-slot-name', name, owner.name);
|
|
|
|
error(attribute, 'duplicate-slot-name', name, owner.name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
context.state.component_slots.add(name);
|
|
|
|
context.state.component_slots.add(name);
|
|
|
|
|
|
|
|
|
|
|
|
if (name === 'default') {
|
|
|
|
if (name === 'default') {
|
|
|
@ -199,6 +204,7 @@ function validate_slot_attribute(context, attribute) {
|
|
|
|
error(node, 'invalid-default-slot-content');
|
|
|
|
error(node, 'invalid-default-slot-content');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
error(attribute, 'invalid-slot-placement');
|
|
|
|
error(attribute, 'invalid-slot-placement');
|
|
|
|
}
|
|
|
|
}
|
|
|
|