adjust error message

pull/4509/head
Conduitry 6 years ago
parent d185a20ea1
commit b43cf2da32

@ -408,7 +408,7 @@ export default class Element extends Node {
if (!(parent.type === 'InlineComponent' || (parent.type === 'Element' && /-/.test(parent.name)))) { if (!(parent.type === 'InlineComponent' || (parent.type === 'Element' && /-/.test(parent.name)))) {
component.error(attribute, { component.error(attribute, {
code: `invalid-slotted-content`, code: `invalid-slotted-content`,
message: `Element with a slot='...' attribute must be a direct descendant of a component or custom element`, message: `Element with a slot='...' attribute must be a child of a component or custom element`,
}); });
} }
} }
@ -419,7 +419,7 @@ export default class Element extends Node {
message: `The 'is' attribute is not supported cross-browser and should be avoided` message: `The 'is' attribute is not supported cross-browser and should be avoided`
}); });
} }
attribute_map.set(attribute.name, attribute); attribute_map.set(attribute.name, attribute);
}); });

@ -1,3 +1,3 @@
export default { export default {
error: [`Element with a slot='...' attribute must be a direct descendant of a component or custom element`] error: [`Element with a slot='...' attribute must be a child of a component or custom element`]
}; };

@ -1,3 +1,3 @@
export default { export default {
error: [`Element with a slot='...' attribute must be a direct descendant of a component or custom element`] error: [`Element with a slot='...' attribute must be a child of a component or custom element`]
}; };

@ -1,3 +1,3 @@
export default { export default {
error: [`Element with a slot='...' attribute must be a direct descendant of a component or custom element`] error: [`Element with a slot='...' attribute must be a child of a component or custom element`]
}; };

@ -1,9 +1,9 @@
<script> <script>
import Nested from "./Nested.svelte"; import Nested from "./Nested.svelte";
</script> </script>
<Nested> <Nested>
<div slot="slot1"> <div slot="slot1">
<div slot="slot2" /> <div slot="slot2" />
</div> </div>
</Nested> </Nested>

@ -1,6 +1,6 @@
[{ [{
"code": "invalid-slotted-content", "code": "invalid-slotted-content",
"message": "Element with a slot='...' attribute must be a direct descendant of a component or custom element", "message": "Element with a slot='...' attribute must be a child of a component or custom element",
"start": { "start": {
"line": 1, "line": 1,
"column": 5, "column": 5,

Loading…
Cancel
Save