@@ -9,14 +9,14 @@ use swc_ecma_ast::{
9
9
TsExprWithTypeArgs , TsExternalModuleRef , TsFnOrConstructorType , TsFnParam , TsFnType ,
10
10
TsImportEqualsDecl , TsImportType , TsIndexSignature , TsIndexedAccessType , TsInferType ,
11
11
TsInterfaceBody , TsInterfaceDecl , TsIntersectionType , TsKeywordType , TsKeywordTypeKind , TsLit ,
12
- TsLitType , TsMappedType , TsMethodSignature , TsModuleBlock , TsModuleDecl , TsModuleName ,
13
- TsModuleRef , TsNamespaceBody , TsNamespaceDecl , TsNamespaceExportDecl , TsNonNullExpr ,
14
- TsOptionalType , TsParamProp , TsParamPropParam , TsParenthesizedType , TsPropertySignature ,
15
- TsQualifiedName , TsRestType , TsThisType , TsThisTypeOrIdent , TsTplLitType , TsTupleElement ,
16
- TsTupleType , TsType , TsTypeAliasDecl , TsTypeAnn , TsTypeAssertion , TsTypeElement , TsTypeLit ,
17
- TsTypeOperator , TsTypeOperatorOp , TsTypeParam , TsTypeParamDecl , TsTypeParamInstantiation ,
18
- TsTypePredicate , TsTypeQuery , TsTypeQueryExpr , TsTypeRef , TsUnionOrIntersectionType ,
19
- TsUnionType ,
12
+ TsLitType , TsMappedType , TsMemberName , TsMethodSignature , TsModuleBlock , TsModuleDecl ,
13
+ TsModuleName , TsModuleRef , TsNamespaceBody , TsNamespaceDecl , TsNamespaceExportDecl ,
14
+ TsNonNullExpr , TsOptionalType , TsParamProp , TsParamPropParam , TsParenthesizedType ,
15
+ TsPropertySignature , TsQualifiedName , TsRestType , TsThisType , TsThisTypeOrIdent , TsTplLitType ,
16
+ TsTupleElement , TsTupleType , TsType , TsTypeAliasDecl , TsTypeAnn , TsTypeAssertion ,
17
+ TsTypeElement , TsTypeLit , TsTypeOperator , TsTypeOperatorOp , TsTypeParam , TsTypeParamDecl ,
18
+ TsTypeParamInstantiation , TsTypePredicate , TsTypeQuery , TsTypeQueryExpr , TsTypeRef ,
19
+ TsUnionOrIntersectionType , TsUnionType ,
20
20
} ;
21
21
use swc_estree_ast:: {
22
22
Access , ArrayPattern , IdOrRest , IdOrString , Identifier , ObjectPattern , RestElement ,
@@ -26,8 +26,8 @@ use swc_estree_ast::{
26
26
TSExpressionWithTypeArguments , TSExternalModuleReference , TSFunctionType ,
27
27
TSImportEqualsDeclModuleRef , TSImportEqualsDeclaration , TSImportType , TSIndexSignature ,
28
28
TSIndexedAccessType , TSInferType , TSInterfaceBody , TSInterfaceDeclaration , TSIntersectionType ,
29
- TSIntrinsicKeyword , TSLiteralType , TSLiteralTypeLiteral , TSMappedType , TSMethodSignature ,
30
- TSModuleBlock , TSModuleDeclBody , TSModuleDeclaration , TSNamedTupleMember ,
29
+ TSIntrinsicKeyword , TSLiteralType , TSLiteralTypeLiteral , TSMappedType , TSMemberName ,
30
+ TSMethodSignature , TSModuleBlock , TSModuleDeclBody , TSModuleDeclaration , TSNamedTupleMember ,
31
31
TSNamespaceExportDeclaration , TSNeverKeyword , TSNonNullExpression , TSNullKeyword ,
32
32
TSNumberKeyword , TSObjectKeyword , TSOptionalType , TSParamPropParam , TSParameterProperty ,
33
33
TSParenthesizedType , TSPropertySignature , TSQualifiedName , TSRestType , TSStringKeyword ,
@@ -192,6 +192,17 @@ impl Babelify for TsEntityName {
192
192
}
193
193
}
194
194
195
+ impl Babelify for TsMemberName {
196
+ type Output = TSMemberName ;
197
+
198
+ fn babelify ( self , ctx : & Context ) -> Self :: Output {
199
+ match self {
200
+ Self :: Ident ( i) => Self :: Output :: Id ( i. babelify ( ctx) ) ,
201
+ Self :: PrivateName ( p) => Self :: Output :: PrivateName ( p. babelify ( ctx) ) ,
202
+ }
203
+ }
204
+ }
205
+
195
206
impl Babelify for TsTypeElement {
196
207
type Output = TSTypeElement ;
197
208
@@ -842,7 +853,8 @@ impl Babelify for TsExprWithTypeArgs {
842
853
base : ctx. base ( e. span ) ,
843
854
left : Box :: new ( babelify_expr ( * e. obj , ctx) ) ,
844
855
right : match e. prop {
845
- MemberProp :: Ident ( id) => id. babelify ( ctx) ,
856
+ MemberProp :: Ident ( id) => TSMemberName :: Id ( id. babelify ( ctx) ) ,
857
+ MemberProp :: PrivateName ( p) => TSMemberName :: PrivateName ( p. babelify ( ctx) ) ,
846
858
_ => unreachable ! ( ) ,
847
859
} ,
848
860
} ) ,
0 commit comments