File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ func (r *referenceResolver) GetReferencedExportContainer(node *ast.IdentifierNod
153
153
// we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
154
154
// kinds that we do NOT prefix.
155
155
exportSymbol := r .getMergedSymbol (symbol .ExportSymbol )
156
- if ! prefixLocals && exportSymbol .Flags & ( ast .SymbolFlagsExportHasLocal | ast .SymbolFlagsVariable ) == 0 {
156
+ if ! prefixLocals && exportSymbol .Flags & ast .SymbolFlagsExportHasLocal != 0 && exportSymbol . Flags & ast .SymbolFlagsVariable == 0 {
157
157
return nil
158
158
}
159
159
symbol = exportSymbol
Original file line number Diff line number Diff line change @@ -1897,7 +1897,7 @@ func (tx *CommonJSModuleTransformer) visitIdentifier(node *ast.IdentifierNode) *
1897
1897
1898
1898
// Visits an identifier in an expression position that might reference an imported or exported symbol.
1899
1899
func (tx * CommonJSModuleTransformer ) visitExpressionIdentifier (node * ast.IdentifierNode ) * ast.Node {
1900
- if info := tx .emitContext .GetAutoGenerateInfo (node ); ! (info != nil && info .Flags .HasAllowNameSubstitution ()) &&
1900
+ if info := tx .emitContext .GetAutoGenerateInfo (node ); ! (info != nil && ! info .Flags .HasAllowNameSubstitution ()) &&
1901
1901
! isHelperName (tx .emitContext , node ) &&
1902
1902
! isLocalName (tx .emitContext , node ) &&
1903
1903
! isDeclarationNameOfEnumOrNamespace (tx .emitContext , node ) {
Original file line number Diff line number Diff line change @@ -936,6 +936,19 @@ exports.a = void 0;
936
936
exports.a = 0;
937
937
exports.a;` ,
938
938
},
939
+ {
940
+ title : "Identifier#3 (from enum)" ,
941
+ input : `export enum E { A }
942
+ E.A` ,
943
+ output : `"use strict";
944
+ Object.defineProperty(exports, "__esModule", { value: true });
945
+ exports.E = void 0;
946
+ var E;
947
+ (function (E) {
948
+ E[E["A"] = 0] = "A";
949
+ })(E || (exports.E = E = {}));
950
+ E.A;` ,
951
+ },
939
952
940
953
{
941
954
title : "Other" ,
You can’t perform that action at this time.
0 commit comments