From 6d2723eec504c5a2572977c1333f74b144bb3d31 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Fri, 8 May 2015 19:12:53 -0700 Subject: [PATCH] New expressions is allowed to have trailing commas in es7 proposal --- src/acorn/src/expression.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/acorn/src/expression.js b/src/acorn/src/expression.js index 3540956fe3..6b8e842e8d 100755 --- a/src/acorn/src/expression.js +++ b/src/acorn/src/expression.js @@ -474,7 +474,10 @@ pp.parseNew = function() { } let start = this.markPosition() node.callee = this.parseSubscripts(this.parseExprAtom(), start, true) - if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, false) + if (this.eat(tt.parenL)) node.arguments = this.parseExprList( + tt.parenR, + this.options.features["es7.trailingFunctionCommas"] + ) else node.arguments = empty return this.finishNode(node, "NewExpression") }