mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Merge pull request #333 from Microsoft/fixContainerList
Properly build container list in binder.
This commit is contained in:
@@ -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;
|
||||
|
||||
19
tests/baselines/reference/testContainerList.js
Normal file
19
tests/baselines/reference/testContainerList.js
Normal 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 = {}));
|
||||
6
tests/cases/compiler/testContainerList.ts
Normal file
6
tests/cases/compiler/testContainerList.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// Regression test for #325
|
||||
module A {
|
||||
class C {
|
||||
constructor(public d: {}) { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user