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
9 changes: 7 additions & 2 deletions src/compiler/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,13 @@ module ts {
parent = node;
if (symbolKind & SymbolFlags.IsContainer) {
container = node;
if (lastContainer) lastContainer.nextContainer = container;
lastContainer = container;
// If container is not on container list, add it to the list
if (lastContainer !== container && !container.nextContainer) {
if (lastContainer) {
lastContainer.nextContainer = container;
}
lastContainer = container;
}
}
forEachChild(node, bind);
container = saveContainer;
Expand Down
19 changes: 19 additions & 0 deletions tests/baselines/reference/testContainerList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [testContainerList.ts]
// Regression test for #325
module A {
class C {
constructor(public d: {}) { }
}
}


//// [testContainerList.js]
var A;
(function (A) {
var C = (function () {
function C(d) {
this.d = d;
}
return C;
})();
})(A || (A = {}));
6 changes: 6 additions & 0 deletions tests/cases/compiler/testContainerList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Regression test for #325
module A {
class C {
constructor(public d: {}) { }
}
}