Merge pull request #1487 from amasad/trailing-commas
[es7.trailingFunctionCommas] Allow in new expressions
This commit is contained in:
commit
cf7d6b655e
@ -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")
|
||||
}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
new Foo(a, b,);
|
||||
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
new Foo(a, b);
|
||||
Loading…
x
Reference in New Issue
Block a user