diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 059f88bef5..0a2b5eec6e 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -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); }); diff --git a/test/runtime/samples/component-slot-nested-error-2/_config.js b/test/runtime/samples/component-slot-nested-error-2/_config.js index 63e6c0fac9..369e543a01 100644 --- a/test/runtime/samples/component-slot-nested-error-2/_config.js +++ b/test/runtime/samples/component-slot-nested-error-2/_config.js @@ -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`] }; diff --git a/test/runtime/samples/component-slot-nested-error-3/_config.js b/test/runtime/samples/component-slot-nested-error-3/_config.js index 63e6c0fac9..369e543a01 100644 --- a/test/runtime/samples/component-slot-nested-error-3/_config.js +++ b/test/runtime/samples/component-slot-nested-error-3/_config.js @@ -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`] }; diff --git a/test/runtime/samples/component-slot-nested-error/_config.js b/test/runtime/samples/component-slot-nested-error/_config.js index 63e6c0fac9..369e543a01 100644 --- a/test/runtime/samples/component-slot-nested-error/_config.js +++ b/test/runtime/samples/component-slot-nested-error/_config.js @@ -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`] }; diff --git a/test/runtime/samples/component-slot-nested-error/main.svelte b/test/runtime/samples/component-slot-nested-error/main.svelte index d69db23739..531c96f08c 100644 --- a/test/runtime/samples/component-slot-nested-error/main.svelte +++ b/test/runtime/samples/component-slot-nested-error/main.svelte @@ -1,9 +1,9 @@ -
-
-
+
+
+
diff --git a/test/validator/samples/slot-attribute-invalid/errors.json b/test/validator/samples/slot-attribute-invalid/errors.json index 00b1ea05c0..247e8261f4 100644 --- a/test/validator/samples/slot-attribute-invalid/errors.json +++ b/test/validator/samples/slot-attribute-invalid/errors.json @@ -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,