make method definitions with expression bodies illegal - fixes #1066
This commit is contained in:
parent
2cbbd86552
commit
6d87a99d1d
@ -597,14 +597,10 @@ pp.parseMethod = function(isGenerator, isAsync) {
|
||||
this.initFunction(node, isAsync)
|
||||
this.expect(tt.parenL)
|
||||
node.params = this.parseBindingList(tt.parenR, false, false)
|
||||
let allowExpressionBody
|
||||
if (this.options.ecmaVersion >= 6) {
|
||||
node.generator = isGenerator
|
||||
allowExpressionBody = true
|
||||
} else {
|
||||
allowExpressionBody = false
|
||||
}
|
||||
this.parseFunctionBody(node, allowExpressionBody)
|
||||
this.parseFunctionBody(node)
|
||||
return this.finishNode(node, "FunctionExpression")
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user