Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25054,7 +25054,7 @@ namespace ts {
// we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the
// kinds that we do NOT prefix.
const exportSymbol = getMergedSymbol(symbol.exportSymbol);
if (!prefixLocals && exportSymbol.flags & SymbolFlags.ExportHasLocal) {
if (!prefixLocals && exportSymbol.flags & SymbolFlags.ExportHasLocal && !(exportSymbol.flags & SymbolFlags.Variable)) {
return undefined;
}
symbol = exportSymbol;
Expand Down
18 changes: 18 additions & 0 deletions tests/baselines/reference/typeFromPropertyAssignmentWithExport.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//// [a.js]
// this is a javascript file...

export const Adapter = {};

Adapter.prop = {};

// comment this out, and it works
Adapter.asyncMethod = function() {}

//// [a.js]
"use strict";
// this is a javascript file...
exports.__esModule = true;
exports.Adapter = {};
exports.Adapter.prop = {};
// comment this out, and it works
exports.Adapter.asyncMethod = function () { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=== tests/cases/conformance/salsa/a.js ===
// this is a javascript file...

export const Adapter = {};
>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18))

Adapter.prop = {};
>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18))

// comment this out, and it works
Adapter.asyncMethod = function() {}
>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18))

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
=== tests/cases/conformance/salsa/a.js ===
// this is a javascript file...

export const Adapter = {};
>Adapter : { [x: string]: any; }
>{} : { [x: string]: any; }

Adapter.prop = {};
>Adapter.prop = {} : {}
>Adapter.prop : any
>Adapter : { [x: string]: any; }
>prop : any
>{} : {}

// comment this out, and it works
Adapter.asyncMethod = function() {}
>Adapter.asyncMethod = function() {} : () => void
>Adapter.asyncMethod : any
>Adapter : { [x: string]: any; }
>asyncMethod : any
>function() {} : () => void

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @allowJs: true
// @checkJs: true
// @Filename: a.js
// @outDir: dist
// this is a javascript file...

export const Adapter = {};

Adapter.prop = {};

// comment this out, and it works
Adapter.asyncMethod = function() {}