try only names generated in current scope with testing if name is unique

This commit is contained in:
Vladimir Matveev
2015-02-14 14:23:37 -08:00
parent b28d72abf7
commit ba52d60c7a

View File

@@ -1696,23 +1696,7 @@ module ts {
function isExistingName(location: Node, name: string) {
if (!resolver.isUnknownIdentifier(location, name)) {
return true;
}
if (currentScopeNames && hasProperty(currentScopeNames, name)) {
return true;
}
var frame = lastFrame;
while (frame) {
if (hasProperty(frame.names, name)) {
return true;
}
frame = frame.previous;
}
return false;
return !resolver.isUnknownIdentifier(location, name) || (currentScopeNames && hasProperty(currentScopeNames, name));
}
function initializeEmitterWithSourceMaps() {