Add JSX spread children

This commit is contained in:
calebmer
2016-06-19 10:48:20 -04:00
parent ca6450b057
commit a25a4ffdc1
3 changed files with 283 additions and 0 deletions

View File

@@ -345,6 +345,15 @@ pp.jsxParseElementAt = function(startPos, startLoc) {
break;
case tt.braceL:
if (this.lookahead().type === tt.ellipsis) {
let node = this.startNode();
this.next();
this.next();
node.expression = this.parseExpression();
this.expect(tt.braceR);
children.push(this.finishNode(node, "JSXSpreadChild"));
break;
}
children.push(this.jsxParseExpressionContainer());
break;