mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
addressed PR feedback
This commit is contained in:
@@ -11115,9 +11115,9 @@ module ts {
|
||||
return hasProperty(globals, name);
|
||||
}
|
||||
|
||||
function isUnknownIdentifier(location: Node, name: string): boolean {
|
||||
Debug.assert(!nodeIsSynthesized(location), "isUnknownIdentifier called with a synthesized location");
|
||||
return !resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
function resolvesToSomeValue(location: Node, name: string): boolean {
|
||||
Debug.assert(!nodeIsSynthesized(location), "resolvesToSomeValue called with a synthesized location");
|
||||
return !!resolveName(location, name, SymbolFlags.Value, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined);
|
||||
}
|
||||
|
||||
function getBlockScopedVariableId(n: Identifier): number {
|
||||
@@ -11161,7 +11161,7 @@ module ts {
|
||||
isSymbolAccessible,
|
||||
isEntityNameVisible,
|
||||
getConstantValue,
|
||||
isUnknownIdentifier,
|
||||
resolvesToSomeValue,
|
||||
collectLinkedAliases,
|
||||
getBlockScopedVariableId,
|
||||
};
|
||||
|
||||
@@ -88,10 +88,6 @@ module ts {
|
||||
return true;
|
||||
}
|
||||
|
||||
function isUnknownNameInEnclosingScope(name: string, location: Node): boolean {
|
||||
return resolver.isUnknownIdentifier(location, name);
|
||||
}
|
||||
|
||||
function emitJavaScript(jsFilePath: string, root?: SourceFile) {
|
||||
let writer = createTextWriter(newLine);
|
||||
let write = writer.write;
|
||||
@@ -254,7 +250,7 @@ module ts {
|
||||
let tempName: string;
|
||||
if (tempVariableKind !== TempVariableKind.auto && !(predefinedTempsInUse & tempVariableKind)) {
|
||||
tempName = tempVariableKind === TempVariableKind._i ? "_i" : "_n";
|
||||
if (resolver.isUnknownIdentifier(location, tempName)) {
|
||||
if (!resolver.resolvesToSomeValue(location, tempName)) {
|
||||
predefinedTempsInUse |= tempVariableKind;
|
||||
return tempName;
|
||||
}
|
||||
@@ -273,8 +269,8 @@ module ts {
|
||||
}
|
||||
|
||||
tempCount++;
|
||||
|
||||
} while (!resolver.isUnknownIdentifier(location, tempName));
|
||||
}
|
||||
while (resolver.resolvesToSomeValue(location, tempName));
|
||||
|
||||
return tempName;
|
||||
}
|
||||
@@ -2817,7 +2813,7 @@ module ts {
|
||||
: blockScopeContainer.parent;
|
||||
|
||||
var hasConflictsInEnclosingScope =
|
||||
!resolver.isUnknownIdentifier(parent, (<Identifier>node).text) ||
|
||||
resolver.resolvesToSomeValue(parent, (<Identifier>node).text) ||
|
||||
nameConflictsWithSomeTempVariable((<Identifier>node).text);
|
||||
|
||||
if (hasConflictsInEnclosingScope) {
|
||||
|
||||
@@ -1219,7 +1219,7 @@ module ts {
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isUnknownIdentifier(location: Node, name: string): boolean;
|
||||
resolvesToSomeValue(location: Node, name: string): boolean;
|
||||
getBlockScopedVariableId(node: Identifier): number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user