@@ -831,9 +831,10 @@ pp.parseProperty = function(isPattern, refDestructuringErrors) {
831
831
}
832
832
833
833
pp . parseGetterSetter = function ( prop ) {
834
- prop . kind = prop . key . name
834
+ const kind = prop . key . name
835
835
this . parsePropertyName ( prop )
836
836
prop . value = this . parseMethod ( false )
837
+ prop . kind = kind
837
838
let paramCount = prop . kind === "get" ? 0 : 1
838
839
if ( prop . value . params . length !== paramCount ) {
839
840
let start = prop . value . start
@@ -856,9 +857,9 @@ pp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos
856
857
prop . kind = "init"
857
858
} else if ( this . options . ecmaVersion >= 6 && this . type === tt . parenL ) {
858
859
if ( isPattern ) this . unexpected ( )
859
- prop . kind = "init"
860
860
prop . method = true
861
861
prop . value = this . parseMethod ( isGenerator , isAsync )
862
+ prop . kind = "init"
862
863
} else if ( ! isPattern && ! containsEsc &&
863
864
this . options . ecmaVersion >= 5 && ! prop . computed && prop . key . type === "Identifier" &&
864
865
( prop . key . name === "get" || prop . key . name === "set" ) &&
@@ -870,7 +871,6 @@ pp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos
870
871
this . checkUnreserved ( prop . key )
871
872
if ( prop . key . name === "await" && ! this . awaitIdentPos )
872
873
this . awaitIdentPos = startPos
873
- prop . kind = "init"
874
874
if ( isPattern ) {
875
875
prop . value = this . parseMaybeDefault ( startPos , startLoc , this . copyNode ( prop . key ) )
876
876
} else if ( this . type === tt . eq && refDestructuringErrors ) {
@@ -880,6 +880,7 @@ pp.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos
880
880
} else {
881
881
prop . value = this . copyNode ( prop . key )
882
882
}
883
+ prop . kind = "init"
883
884
prop . shorthand = true
884
885
} else this . unexpected ( )
885
886
}
0 commit comments