Merge pull request #42 from calebmer/feat/jsx-spread-children

Add JSX spread children
This commit is contained in:
Sebastian McKenzie
2016-07-13 01:32:09 +01:00
committed by GitHub
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;