feat: CallExpression support

This commit is contained in:
Sven SAULEAU
2017-05-30 20:12:43 +02:00
parent 26096d6a3d
commit 9bcd85acf3
4 changed files with 146 additions and 0 deletions

View File

@@ -316,6 +316,16 @@ export default class ExpressionParser extends LValParser {
node.computed = true;
this.expect(tt.bracketR);
base = this.finishNode(node, "MemberExpression");
} if (this.eat(tt.parenL)) {
const possibleAsync = this.state.potentialArrowAt === base.start &&
base.type === "Identifier" &&
base.name === "async" &&
!this.canInsertSemicolon();
node.arguments = this.parseCallExpressionArguments(tt.parenR, possibleAsync);
node.optional = true;
base = this.finishNode(node, "CallExpression");
} else {
node.object = base;
node.property = this.parseIdentifier(true);