From cea11935e88967e74701e0f35ecf8e174cdccb3f Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Sun, 15 Mar 2020 11:00:56 +0800 Subject: [PATCH] update error message --- src/compiler/compile/nodes/Element.ts | 2 +- test/runtime/samples/component-slot-nested-error-2/_config.js | 2 +- test/runtime/samples/component-slot-nested-error-3/_config.js | 2 +- test/runtime/samples/component-slot-nested-error/_config.js | 2 +- .../samples/component-slotted-custom-element-2/errors.json | 2 +- test/validator/samples/component-slotted-each-block/errors.json | 2 +- test/validator/samples/component-slotted-if-block/errors.json | 2 +- test/validator/samples/slot-attribute-invalid/errors.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index aebcdfb213..8c9c0bfe18 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -398,7 +398,7 @@ export default class Element extends Node { if (!(parent.type === 'InlineComponent' || within_custom_element(parent))) { component.error(attribute, { code: `invalid-slotted-content`, - message: `Element with a slot='...' attribute must be a child of a component or custom element`, + message: `Element with a slot='...' attribute must be a child of a component or a descendant of a custom element`, }); } } 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 369e543a01..98a9f1cab0 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 child of a component or custom element`] + error: [`Element with a slot='...' attribute must be a child of a component or a descendant of a 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 369e543a01..98a9f1cab0 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 child of a component or custom element`] + error: [`Element with a slot='...' attribute must be a child of a component or a descendant of a 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 369e543a01..98a9f1cab0 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 child of a component or custom element`] + error: [`Element with a slot='...' attribute must be a child of a component or a descendant of a custom element`] }; diff --git a/test/validator/samples/component-slotted-custom-element-2/errors.json b/test/validator/samples/component-slotted-custom-element-2/errors.json index b2f39aa8d2..06be51d72d 100644 --- a/test/validator/samples/component-slotted-custom-element-2/errors.json +++ b/test/validator/samples/component-slotted-custom-element-2/errors.json @@ -1,7 +1,7 @@ [ { "code": "invalid-slotted-content", - "message": "Element with a slot='...' attribute must be a child of a component or custom element", + "message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element", "start": { "line": 10, "column": 9, "character": 138 }, "end": { "line": 10, "column": 19, "character": 148 }, "pos": 138 diff --git a/test/validator/samples/component-slotted-each-block/errors.json b/test/validator/samples/component-slotted-each-block/errors.json index d1f844f34f..2944acae17 100644 --- a/test/validator/samples/component-slotted-each-block/errors.json +++ b/test/validator/samples/component-slotted-each-block/errors.json @@ -1,6 +1,6 @@ [{ "code": "invalid-slotted-content", - "message": "Element with a slot='...' attribute must be a child of a component or custom element", + "message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element", "start": { "line": 7, "column": 7, diff --git a/test/validator/samples/component-slotted-if-block/errors.json b/test/validator/samples/component-slotted-if-block/errors.json index 085a2a940a..3ae07c1b3b 100644 --- a/test/validator/samples/component-slotted-if-block/errors.json +++ b/test/validator/samples/component-slotted-if-block/errors.json @@ -1,6 +1,6 @@ [{ "code": "invalid-slotted-content", - "message": "Element with a slot='...' attribute must be a child of a component or custom element", + "message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element", "start": { "line": 7, "column": 7, diff --git a/test/validator/samples/slot-attribute-invalid/errors.json b/test/validator/samples/slot-attribute-invalid/errors.json index 247e8261f4..a75fdc065c 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 child of a component or custom element", + "message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element", "start": { "line": 1, "column": 5,