From 6fa51f1c029baa0881aa0fbf062a5d5562821180 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 16 Jan 2016 12:59:02 -0800 Subject: [PATCH 1/2] Go back to depending on nightly builds of TypeScript. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f0ba128a919..261cdfa64b7 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "istanbul": "latest", "mocha-fivemat-progress-reporter": "latest", "tslint": "next", - "typescript": "1.8.0-dev.20160113", + "typescript": "next", "tsd": "latest" }, "scripts": { From 26fdf891e9829a0ff9051d40a944196cd4444991 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 16 Jan 2016 14:05:46 -0800 Subject: [PATCH 2/2] Fix lint errors. --- src/compiler/checker.ts | 2 +- src/compiler/core.ts | 3 ++- src/compiler/emitter.ts | 10 +++++----- src/compiler/program.ts | 2 +- src/services/services.ts | 3 ++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 573c0655cce..e0f40d5085e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14600,7 +14600,7 @@ namespace ts { } function hasExportedMembers(moduleSymbol: Symbol) { - for (var id in moduleSymbol.exports) { + for (const id in moduleSymbol.exports) { if (id !== "export=") { return true; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 4056d9c3e9d..cfdcb2b930c 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -718,7 +718,8 @@ namespace ts { } // Find the component that differs - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { + let joinStartIndex: number; + for (joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { break; } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index ea0330a23b9..417e245dae5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1250,7 +1250,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi else { // One object literal with all the attributes in them write("{"); - for (var i = 0; i < attrs.length; i++) { + for (let i = 0, n = attrs.length; i < n; i++) { if (i > 0) { write(", "); } @@ -1262,7 +1262,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // Children if (children) { - for (var i = 0; i < children.length; i++) { + for (let i = 0; i < children.length; i++) { // Don't emit empty expressions if (children[i].kind === SyntaxKind.JsxExpression && !((children[i]).expression)) { continue; @@ -1356,7 +1356,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi function emitJsxElement(node: JsxElement) { emitJsxOpeningOrSelfClosingElement(node.openingElement); - for (var i = 0, n = node.children.length; i < n; i++) { + for (let i = 0, n = node.children.length; i < n; i++) { emit(node.children[i]); } @@ -5172,7 +5172,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. if (isClassExpressionWithStaticProperties) { - for (var property of staticProperties) { + for (const property of staticProperties) { write(","); writeLine(); emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true); @@ -5719,7 +5719,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi const parameters = valueDeclaration.parameters; const parameterCount = parameters.length; if (parameterCount > 0) { - for (var i = 0; i < parameterCount; i++) { + for (let i = 0; i < parameterCount; i++) { if (i > 0) { write(", "); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 52c9fa4ef84..398ce27ef48 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1217,7 +1217,7 @@ namespace ts { if (sourceFiles) { const absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var sourceFile of sourceFiles) { + for (const sourceFile of sourceFiles) { if (!isDeclarationFile(sourceFile)) { const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { diff --git a/src/services/services.ts b/src/services/services.ts index e449c40a870..0fae1c0aa45 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6828,7 +6828,8 @@ namespace ts { function classifyDisabledMergeCode(text: string, start: number, end: number) { // Classify the line that the ======= marker is on as a comment. Then just lex // all further tokens and add them to the result. - for (var i = start; i < end; i++) { + let i: number; + for (i = start; i < end; i++) { if (isLineBreak(text.charCodeAt(i))) { break; }