validate contents of await blocks (#1061)

pull/1093/head
Rich Harris 8 years ago
parent 9cfa174703
commit 5fea63a5de

@ -54,6 +54,12 @@ export default function validateHtml(validator: Validator, html: Node) {
if (node.else) { if (node.else) {
visit(node.else); visit(node.else);
} }
if (node.type === 'AwaitBlock') {
visit(node.pending);
visit(node.then);
visit(node.catch);
}
} }
html.children.forEach(visit); html.children.forEach(visit);

@ -0,0 +1,17 @@
{{#await promise}}
<p>Loading</p>
{{then data}}
<Component :data />
{{catch err}}
<p>Error: {{err}}</p>
{{/await}}
<script>
import Component from './Component.html';
export default {
components: {
Component
}
};
</script>
Loading…
Cancel
Save