error if component has transition (fixes #791)

pull/793/head
Rich Harris 7 years ago
parent 87ef5ffefd
commit cb92f3028e

@ -116,6 +116,10 @@ export default function validateElement(validator: Validator, node: Node, refs:
} else if (attribute.type === 'EventHandler') {
validateEventHandler(validator, attribute, refCallees);
} else if (attribute.type === 'Transition') {
if (isComponent) {
validator.error(`Transitions can only be applied to DOM elements, not components`, attribute.start);
}
const bidi = attribute.intro && attribute.outro;
if (hasTransition) {

@ -0,0 +1,8 @@
[{
"message": "Transitions can only be applied to DOM elements, not components",
"loc": {
"line": 1,
"column": 8
},
"pos": 8
}]

@ -0,0 +1,15 @@
<Widget in:foo/>
<script>
import Widget from './Widget.html';
export default {
components: {
Widget
},
transitions: {
foo() {}
}
};
</script>
Loading…
Cancel
Save