Merge pull request #333 from Microsoft/fixContainerList

Properly build container list in binder.
This commit is contained in:
Anders Hejlsberg
2014-08-03 15:23:10 -07:00
3 changed files with 32 additions and 2 deletions

View File

@@ -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;

View File

@@ -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 = {}));

View File

@@ -0,0 +1,6 @@
// Regression test for #325
module A {
class C {
constructor(public d: {}) { }
}
}