@@ -903,7 +903,7 @@ pp.parsePropertyName = function(prop) {
903
903
904
904
pp . initFunction = function ( node ) {
905
905
node . id = null
906
- if ( this . options . ecmaVersion >= 6 ) node . generator = node . expression = false
906
+ if ( this . options . ecmaVersion >= 6 ) node . generator = false
907
907
if ( this . options . ecmaVersion >= 8 ) node . async = false
908
908
}
909
909
@@ -959,12 +959,14 @@ pp.parseArrowExpression = function(node, params, isAsync, forInit) {
959
959
// Parse function body and check parameters.
960
960
961
961
pp . parseFunctionBody = function ( node , isArrowFunction , isMethod , forInit ) {
962
- let isExpression = isArrowFunction && this . type !== tt . braceL
963
962
let oldStrict = this . strict , useStrict = false
964
963
965
- if ( isExpression ) {
964
+ if ( isArrowFunction ) {
965
+ node . expression = this . type !== tt . braceL
966
+ }
967
+
968
+ if ( node . expression ) {
966
969
node . body = this . parseMaybeAssign ( forInit )
967
- node . expression = true
968
970
this . checkParams ( node , false )
969
971
} else {
970
972
let nonSimple = this . options . ecmaVersion >= 7 && ! this . isSimpleParamList ( node . params )
@@ -988,10 +990,10 @@ pp.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
988
990
// Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
989
991
if ( this . strict && node . id ) this . checkLValSimple ( node . id , BIND_OUTSIDE )
990
992
node . body = this . parseBlock ( false , undefined , useStrict && ! oldStrict )
991
- node . expression = false
992
993
this . adaptDirectivePrologue ( node . body . body )
993
994
this . labels = oldLabels
994
995
}
996
+
995
997
this . exitScope ( )
996
998
}
997
999
0 commit comments