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)))) {
component.error(attribute, {
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`
});
}
attribute_map.set(attribute.name, attribute);
});

@ -1,3 +1,3 @@
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 {
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 {
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>
import Nested from "./Nested.svelte";
import Nested from "./Nested.svelte";
</script>
<Nested>
<div slot="slot1">
<div slot="slot2" />
</div>
<div slot="slot1">
<div slot="slot2" />
</div>
</Nested>

@ -1,6 +1,6 @@
[{
"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": {
"line": 1,
"column": 5,

Loading…
Cancel
Save