Merge pull request #1487 from amasad/trailing-commas

[es7.trailingFunctionCommas] Allow in new expressions
This commit is contained in:
Sebastian McKenzie 2015-05-09 03:16:18 +01:00
commit cf7d6b655e
3 changed files with 8 additions and 1 deletions

View File

@ -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")
}

View File

@ -0,0 +1,3 @@
"use strict";
new Foo(a, b);