Skip to content

Commit 894aa3f

Browse files
committed
fix: handle duplicate accessors
Signed-off-by: Kubilay Kahveci <kahvecikubilay@gmail.com>
1 parent 34cf6ee commit 894aa3f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/compiler/transformers/classFields.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,7 @@ namespace ts {
11191119
if (isGetAccessor(node)) {
11201120
const getterName = createHoistedVariableForPrivateName(text + "_get");
11211121

1122-
if (previousInfo) {
1123-
Debug.assert(previousInfo.placement === PrivateIdentifierPlacement.InstanceSetterOnly);
1122+
if (previousInfo?.placement === PrivateIdentifierPlacement.InstanceSetterOnly) {
11241123
info = {
11251124
placement: PrivateIdentifierPlacement.InstanceGetterAndSetter,
11261125
getterName,
@@ -1137,8 +1136,7 @@ namespace ts {
11371136
else {
11381137
const setterName = createHoistedVariableForPrivateName(text + "_set");
11391138

1140-
if (previousInfo) {
1141-
Debug.assert(previousInfo.placement === PrivateIdentifierPlacement.InstanceGetterOnly);
1139+
if (previousInfo?.placement === PrivateIdentifierPlacement.InstanceGetterOnly) {
11421140
info = {
11431141
placement: PrivateIdentifierPlacement.InstanceGetterAndSetter,
11441142
setterName,

0 commit comments

Comments
 (0)