From 6d87a99d1d6cce9b983ff0a50c21cccf59145bf8 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 23 Mar 2015 20:24:32 +1100 Subject: [PATCH] make method definitions with expression bodies illegal - fixes #1066 --- src/expression.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/expression.js b/src/expression.js index 0702837dcb..a0dbb57831 100755 --- a/src/expression.js +++ b/src/expression.js @@ -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") }