Skip to content

Commit 7b67ac2

Browse files
committed
Addressing CR feedback
1 parent fc1bafd commit 7b67ac2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11790,10 +11790,14 @@ module ts {
1179011790
let symbol = getReferencedValueSymbol(node);
1179111791
if (symbol) {
1179211792
if (symbol.flags & SymbolFlags.ExportValue) {
11793+
// If we reference an exported entity within the same module declaration, then whether
11794+
// we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
11795+
// kinds that we do NOT prefix.
1179311796
let exportSymbol = getMergedSymbol(symbol.exportSymbol);
11794-
if (!(exportSymbol.flags & SymbolFlags.ExportHasLocal)) {
11795-
symbol = exportSymbol;
11797+
if (exportSymbol.flags & SymbolFlags.ExportHasLocal) {
11798+
return undefined;
1179611799
}
11800+
symbol = exportSymbol;
1179711801
}
1179811802
let parentSymbol = getParentOfSymbol(symbol);
1179911803
if (parentSymbol) {

src/compiler/emitter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,6 +2841,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
28412841
}
28422842

28432843
function createPropertyAccessForDestructuringProperty(object: Expression, propName: Identifier | LiteralExpression): Expression {
2844+
// We create a synthetic copy of the identifier in order to avoid the rewriting that might
2845+
// otherwise occur when the identifier is emitted.
28442846
let syntheticName = <Identifier | LiteralExpression>createSynthesizedNode(propName.kind);
28452847
syntheticName.text = propName.text;
28462848
if (syntheticName.kind !== SyntaxKind.Identifier) {

0 commit comments

Comments
 (0)