mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Simplify how we set container.nextContainer now that we don't double recurse.
This commit is contained in:
parent
9bb6cee923
commit
cb8d2f28ae
@ -227,23 +227,27 @@ module ts {
|
||||
if (symbolKind & SymbolFlags.HasLocals) {
|
||||
node.locals = {};
|
||||
}
|
||||
|
||||
var saveParent = parent;
|
||||
var saveContainer = container;
|
||||
var savedBlockScopeContainer = blockScopeContainer;
|
||||
parent = node;
|
||||
if (symbolKind & SymbolFlags.IsContainer) {
|
||||
container = node;
|
||||
// If container is not on container list, add it to the list
|
||||
if (lastContainer !== container && !container.nextContainer) {
|
||||
if (lastContainer) {
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
lastContainer = container;
|
||||
Debug.assert(container.nextContainer === undefined);
|
||||
|
||||
if (lastContainer) {
|
||||
Debug.assert(lastContainer.nextContainer === undefined);
|
||||
lastContainer.nextContainer = container;
|
||||
}
|
||||
|
||||
lastContainer = container;
|
||||
}
|
||||
|
||||
if (isBlockScopeContainer) {
|
||||
blockScopeContainer = node;
|
||||
}
|
||||
|
||||
forEachChild(node, bind);
|
||||
container = saveContainer;
|
||||
parent = saveParent;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user