Properly build container list in binder.

Containers are added to container list only if they aren't already on the list.
Fixes #325.
This commit is contained in:
Anders Hejlsberg 2014-08-01 12:36:09 -07:00
parent 13bbb98a1e
commit e6ea85d31b

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;