@@ -512,7 +512,7 @@ module TypeScript {
512512 for ( var i = 0 , n = fileNames . length ; i < n ; i ++ ) {
513513 var fileName = fileNames [ i ] ;
514514
515- var document = this . getDocument ( fileNames [ i ] ) ;
515+ var document = this . getDocument ( fileName ) ;
516516
517517 sharedEmitter = this . _emitDocumentDeclarations ( document , emitOptions ,
518518 file => emitOutput . outputFiles . push ( file ) , sharedEmitter ) ;
@@ -578,7 +578,6 @@ module TypeScript {
578578 var sourceUnit = document . sourceUnit ( ) ;
579579 Debug . assert ( this . _shouldEmit ( document ) ) ;
580580
581- var typeScriptFileName = document . fileName ;
582581 if ( ! emitter ) {
583582 var javaScriptFileName = this . mapOutputFileName ( document , emitOptions , TypeScriptCompiler . mapToJSFileName ) ;
584583 var outFile = new TextWriter ( javaScriptFileName , this . writeByteOrderMarkForDocument ( document ) , OutputFileType . JavaScript ) ;
@@ -799,8 +798,6 @@ module TypeScript {
799798 }
800799
801800 private extractResolutionContextFromAST ( resolver : PullTypeResolver , ast : ISyntaxElement , document : Document , propagateContextualTypes : boolean ) : { ast : ISyntaxElement ; enclosingDecl : PullDecl ; resolutionContext : PullTypeResolutionContext ; inContextuallyTypedAssignment : boolean ; inWithBlock : boolean ; } {
802- var scriptName = document . fileName ;
803-
804801 var enclosingDecl : PullDecl = null ;
805802 var enclosingDeclAST : ISyntaxElement = null ;
806803 var inContextuallyTypedAssignment = false ;
@@ -981,7 +978,6 @@ module TypeScript {
981978
982979 case SyntaxKind . ReturnStatement :
983980 if ( propagateContextualTypes ) {
984- var returnStatement = < ReturnStatementSyntax > current ;
985981 var contextualType : PullTypeSymbol = null ;
986982
987983 if ( enclosingDecl && ( enclosingDecl . kind & PullElementKind . SomeFunction ) ) {
0 commit comments