@@ -903,7 +903,7 @@ pp.parsePropertyName = function(prop) {
903903
904904pp . initFunction = function ( node ) {
905905 node . id = null
906- if ( this . options . ecmaVersion >= 6 ) node . generator = node . expression = false
906+ if ( this . options . ecmaVersion >= 6 ) node . generator = false
907907 if ( this . options . ecmaVersion >= 8 ) node . async = false
908908}
909909
@@ -959,12 +959,14 @@ pp.parseArrowExpression = function(node, params, isAsync, forInit) {
959959// Parse function body and check parameters.
960960
961961pp . parseFunctionBody = function ( node , isArrowFunction , isMethod , forInit ) {
962- let isExpression = isArrowFunction && this . type !== tt . braceL
963962 let oldStrict = this . strict , useStrict = false
964963
965- if ( isExpression ) {
964+ if ( isArrowFunction ) {
965+ node . expression = this . type !== tt . braceL
966+ }
967+
968+ if ( node . expression ) {
966969 node . body = this . parseMaybeAssign ( forInit )
967- node . expression = true
968970 this . checkParams ( node , false )
969971 } else {
970972 let nonSimple = this . options . ecmaVersion >= 7 && ! this . isSimpleParamList ( node . params )
@@ -988,10 +990,10 @@ pp.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
988990 // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
989991 if ( this . strict && node . id ) this . checkLValSimple ( node . id , BIND_OUTSIDE )
990992 node . body = this . parseBlock ( false , undefined , useStrict && ! oldStrict )
991- node . expression = false
992993 this . adaptDirectivePrologue ( node . body . body )
993994 this . labels = oldLabels
994995 }
996+
995997 this . exitScope ( )
996998}
997999
0 commit comments