From 990bbb2dce862eb536bebdad663fdd2c94deda90 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 19 Feb 2015 15:52:37 -0800 Subject: [PATCH] CR feedback to use template strings. --- src/compiler/tsc.ts | 4 ++-- src/compiler/utilities.ts | 2 +- src/harness/fourslash.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 68e85d3f71d..a3755650aed 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -88,11 +88,11 @@ module ts { if (diagnostic.file) { var loc = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); - output += diagnostic.file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + "): "; + output += `${ diagnostic.file.fileName }(${ loc.line + 1 },${ loc.character + 1 }): `; } var category = DiagnosticCategory[diagnostic.category].toLowerCase(); - output += category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) + sys.newLine; + output += `${ category } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) }${ sys.newLine }`; sys.write(output); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 6b336544eba..6a85a5d7a78 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -114,7 +114,7 @@ module ts { export function nodePosToString(node: Node): string { var file = getSourceFileOfNode(node); var loc = getLineAndCharacterOfPosition(file, node.pos); - return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; + return `${ file.fileName }(${ loc.line + 1 },${ loc.character + 1 })`; } export function getStartPosOfNode(node: Node): number { diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index e40a367074d..cfc5da02f88 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -396,7 +396,7 @@ module FourSlash { var lineStarts = ts.computeLineStarts(this.getFileContent(this.activeFile.fileName)); var lineCharPos = ts.computeLineAndCharacterOfPosition(lineStarts, pos); - this.scenarioActions.push(''); + this.scenarioActions.push(``); } public moveCaretRight(count = 1) {