@@ -88,10 +88,6 @@ module ts {
8888 return true ;
8989 }
9090
91- function isUnknownNameInEnclosingScope ( name : string , location : Node ) : boolean {
92- return resolver . isUnknownIdentifier ( location , name ) ;
93- }
94-
9591 function emitJavaScript ( jsFilePath : string , root ?: SourceFile ) {
9692 let writer = createTextWriter ( newLine ) ;
9793 let write = writer . write ;
@@ -254,7 +250,7 @@ module ts {
254250 let tempName : string ;
255251 if ( tempVariableKind !== TempVariableKind . auto && ! ( predefinedTempsInUse & tempVariableKind ) ) {
256252 tempName = tempVariableKind === TempVariableKind . _i ? "_i" : "_n" ;
257- if ( resolver . isUnknownIdentifier ( location , tempName ) ) {
253+ if ( ! resolver . resolvesToSomeValue ( location , tempName ) ) {
258254 predefinedTempsInUse |= tempVariableKind ;
259255 return tempName ;
260256 }
@@ -273,8 +269,8 @@ module ts {
273269 }
274270
275271 tempCount ++ ;
276-
277- } while ( ! resolver . isUnknownIdentifier ( location , tempName ) ) ;
272+ }
273+ while ( resolver . resolvesToSomeValue ( location , tempName ) ) ;
278274
279275 return tempName ;
280276 }
@@ -2817,7 +2813,7 @@ module ts {
28172813 : blockScopeContainer . parent ;
28182814
28192815 var hasConflictsInEnclosingScope =
2820- ! resolver . isUnknownIdentifier ( parent , ( < Identifier > node ) . text ) ||
2816+ resolver . resolvesToSomeValue ( parent , ( < Identifier > node ) . text ) ||
28212817 nameConflictsWithSomeTempVariable ( ( < Identifier > node ) . text ) ;
28222818
28232819 if ( hasConflictsInEnclosingScope ) {
0 commit comments