Merge pull request #1215 from AluisioASG/es7-trailing-function-commas

ES7 trailing function commas
This commit is contained in:
Sebastian McKenzie 2015-04-12 19:17:02 -07:00
commit 7944e3b1fa
2 changed files with 2 additions and 2 deletions

View File

@ -226,7 +226,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)

View File

@ -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