From 648c697257c3dab104889c154319588feef8e20b Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Wed, 15 Oct 2014 20:11:35 +0200 Subject: [PATCH] Removed some unused var statements --- src/services/compiler/declarationEmitter.ts | 16 ---------------- src/services/compiler/typescript.ts | 6 +----- src/services/core/integerUtilities.ts | 6 ------ src/services/syntax/syntaxTree.ts | 1 - 4 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/services/compiler/declarationEmitter.ts b/src/services/compiler/declarationEmitter.ts index 85e5bf09647..460904b7e88 100644 --- a/src/services/compiler/declarationEmitter.ts +++ b/src/services/compiler/declarationEmitter.ts @@ -476,8 +476,6 @@ module TypeScript { //} } - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(this.semanticInfoChain); this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -603,11 +601,6 @@ module TypeScript { private emitConstructSignature(funcDecl: ConstructSignatureSyntax) { var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -633,11 +626,6 @@ module TypeScript { private emitMethodSignature(funcDecl: MethodSignatureSyntax) { var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - this.emitDeclarationComments(funcDecl); this.emitIndent(); @@ -817,7 +805,6 @@ module TypeScript { var parameter = funcDecl.callSignature.parameterList.parameters[i]; var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); if (hasFlag(parameterDecl.flags, PullElementFlags.PropertyParameter)) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); this.emitDeclarationComments(parameter); this.declFile.Write(this.getIndentString()); this.emitClassElementModifiers(parameter.modifiers); @@ -838,7 +825,6 @@ module TypeScript { var className = classDecl.identifier.text(); this.emitDeclarationComments(classDecl); - var classPullDecl = this.semanticInfoChain.getDeclForAST(classDecl); this.emitDeclFlags(classDecl, "class"); this.declFile.Write(className); @@ -934,7 +920,6 @@ module TypeScript { var interfaceName = interfaceDecl.identifier.text(); this.emitDeclarationComments(interfaceDecl); - var interfacePullDecl = this.semanticInfoChain.getDeclForAST(interfaceDecl); this.emitDeclFlags(interfaceDecl, "interface"); this.declFile.Write(interfaceName); @@ -980,7 +965,6 @@ module TypeScript { } this.emitDeclarationComments(moduleDecl); - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); this.emitDeclFlags(moduleDecl, "enum"); this.declFile.WriteLine(moduleDecl.identifier.text() + " {"); diff --git a/src/services/compiler/typescript.ts b/src/services/compiler/typescript.ts index f98d0baf52b..5671d167d1b 100644 --- a/src/services/compiler/typescript.ts +++ b/src/services/compiler/typescript.ts @@ -512,7 +512,7 @@ module TypeScript { for (var i = 0, n = fileNames.length; i < n; i++) { var fileName = fileNames[i]; - var document = this.getDocument(fileNames[i]); + var document = this.getDocument(fileName); sharedEmitter = this._emitDocumentDeclarations(document, emitOptions, file => emitOutput.outputFiles.push(file), sharedEmitter); @@ -578,7 +578,6 @@ module TypeScript { var sourceUnit = document.sourceUnit(); Debug.assert(this._shouldEmit(document)); - var typeScriptFileName = document.fileName; if (!emitter) { var javaScriptFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToJSFileName); var outFile = new TextWriter(javaScriptFileName, this.writeByteOrderMarkForDocument(document), OutputFileType.JavaScript); @@ -799,8 +798,6 @@ module TypeScript { } private extractResolutionContextFromAST(resolver: PullTypeResolver, ast: ISyntaxElement, document: Document, propagateContextualTypes: boolean): { ast: ISyntaxElement; enclosingDecl: PullDecl; resolutionContext: PullTypeResolutionContext; inContextuallyTypedAssignment: boolean; inWithBlock: boolean; } { - var scriptName = document.fileName; - var enclosingDecl: PullDecl = null; var enclosingDeclAST: ISyntaxElement = null; var inContextuallyTypedAssignment = false; @@ -981,7 +978,6 @@ module TypeScript { case SyntaxKind.ReturnStatement: if (propagateContextualTypes) { - var returnStatement = current; var contextualType: PullTypeSymbol = null; if (enclosingDecl && (enclosingDecl.kind & PullElementKind.SomeFunction)) { diff --git a/src/services/core/integerUtilities.ts b/src/services/core/integerUtilities.ts index 0af38471dfd..b0a4d6667b9 100644 --- a/src/services/core/integerUtilities.ts +++ b/src/services/core/integerUtilities.ts @@ -7,12 +7,6 @@ module TypeScript { } export function integerMultiplyLow32Bits(n1: number, n2: number): number { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; return resultLow32; } diff --git a/src/services/syntax/syntaxTree.ts b/src/services/syntax/syntaxTree.ts index 1e8ac95c483..1c68350d918 100644 --- a/src/services/syntax/syntaxTree.ts +++ b/src/services/syntax/syntaxTree.ts @@ -84,7 +84,6 @@ module TypeScript { private cacheSyntaxTreeInfo(): void { // If we're not keeping around the syntax tree, store the diagnostics and line // map so they don't have to be recomputed. - var sourceUnit = this.sourceUnit(); var firstToken = firstSyntaxTreeToken(this); var leadingTrivia = firstToken.leadingTrivia(this.text);