From 2a483187a7a6f9073ac928ca4cde8609a0ee8040 Mon Sep 17 00:00:00 2001 From: Dick van den Brink Date: Thu, 25 Jun 2015 00:23:13 +0200 Subject: [PATCH] Remove unused variables --- src/compiler/checker.ts | 6 ++---- src/compiler/declarationEmitter.ts | 1 - src/compiler/parser.ts | 1 - src/compiler/program.ts | 1 - src/compiler/utilities.ts | 1 - src/services/services.ts | 2 -- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 609a154ded1..49a61a2fd08 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3518,7 +3518,6 @@ namespace ts { let syntaxKind = kind === IndexKind.Number ? SyntaxKind.NumberKeyword : SyntaxKind.StringKeyword; let indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { - let len = indexSymbol.declarations.length; for (let decl of indexSymbol.declarations) { let node = decl; if (node.parameters.length === 1) { @@ -8374,12 +8373,12 @@ namespace ts { } function checkTypeOfExpression(node: TypeOfExpression): Type { - let operandType = checkExpression(node.expression); + checkExpression(node.expression); return stringType; } function checkVoidExpression(node: VoidExpression): Type { - let operandType = checkExpression(node.expression); + checkExpression(node.expression); return undefinedType; } @@ -12380,7 +12379,6 @@ namespace ts { case SyntaxKind.StringLiteral: // External module name in an import declaration - let moduleName: Expression; if ((isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || ((node.parent.kind === SyntaxKind.ImportDeclaration || node.parent.kind === SyntaxKind.ExportDeclaration) && diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 2ba88f1ac29..54d0d6ff854 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -40,7 +40,6 @@ namespace ts { function emitDeclarations(host: EmitHost, resolver: EmitResolver, diagnostics: Diagnostic[], jsFilePath: string, root?: SourceFile): DeclarationEmit { let newLine = host.getNewLine(); let compilerOptions = host.getCompilerOptions(); - let languageVersion = compilerOptions.target || ScriptTarget.ES3; let write: (s: string) => void; let writeLine: () => void; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index fbb3dad5037..2c496b8c60d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5363,7 +5363,6 @@ namespace ts { let atToken = createNode(SyntaxKind.AtToken, pos - 1); atToken.end = pos; - let startPos = pos; let tagName = scanIdentifier(); if (!tagName) { return; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 2af9ad9987d..09bd6fbdd28 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -337,7 +337,6 @@ namespace ts { function processSourceFile(fileName: string, isDefaultLib: boolean, refFile?: SourceFile, refPos?: number, refEnd?: number) { let start: number; let length: number; - let extensions: string; let diagnosticArgument: string[]; if (refEnd !== undefined && refPos !== undefined) { start = refPos; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 8162625c25f..ce166aa2f36 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1957,7 +1957,6 @@ namespace ts { function getExpandedCharCodes(input: string): number[] { let output: number[] = []; let length = input.length; - let leadSurrogate: number = undefined; for (let i = 0; i < length; i++) { let charCode = input.charCodeAt(i); diff --git a/src/services/services.ts b/src/services/services.ts index 18510b9a178..077a46a7461 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -95,7 +95,6 @@ namespace ts { export module ScriptSnapshot { class StringScriptSnapshot implements IScriptSnapshot { - private _lineStartPositions: number[] = undefined; constructor(private text: string) { } @@ -2910,7 +2909,6 @@ namespace ts { } let location = getTouchingPropertyName(sourceFile, position); - var target = program.getCompilerOptions().target; let semanticStart = new Date().getTime(); let isMemberCompletion: boolean;