[ES7] Trailing comma in function parameter list
Currenly a stage 1 proposal. See https://github.com/jeffmo/es-trailing-function-commas.
This commit is contained in:
parent
9a3e36055d
commit
58284c5002
@ -224,7 +224,7 @@ pp.parseSubscripts = function(base, start, noCalls) {
|
||||
} else if (!noCalls && this.eat(tt.parenL)) {
|
||||
let node = this.startNodeAt(start)
|
||||
node.callee = base
|
||||
node.arguments = this.parseExprList(tt.parenR, false)
|
||||
node.arguments = this.parseExprList(tt.parenR, this.options.features["es7.trailingFunctionCommas"])
|
||||
return this.parseSubscripts(this.finishNode(node, "CallExpression"), start, noCalls)
|
||||
} else if (this.type === tt.backQuote) {
|
||||
let node = this.startNodeAt(start)
|
||||
|
||||
@ -458,7 +458,7 @@ pp.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) {
|
||||
|
||||
pp.parseFunctionParams = function(node) {
|
||||
this.expect(tt.parenL)
|
||||
node.params = this.parseBindingList(tt.parenR, false, false)
|
||||
node.params = this.parseBindingList(tt.parenR, false, this.options.features["es7.trailingFunctionCommas"])
|
||||
}
|
||||
|
||||
// Parse a class declaration or literal (depending on the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user