Skip to content

Commit 990bbb2

Browse files
CR feedback to use template strings.
1 parent cdc1b90 commit 990bbb2

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/compiler/tsc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ module ts {
8888
if (diagnostic.file) {
8989
var loc = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
9090

91-
output += diagnostic.file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + "): ";
91+
output += `${ diagnostic.file.fileName }(${ loc.line + 1 },${ loc.character + 1 }): `;
9292
}
9393

9494
var category = DiagnosticCategory[diagnostic.category].toLowerCase();
95-
output += category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) + sys.newLine;
95+
output += `${ category } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, sys.newLine) }${ sys.newLine }`;
9696

9797
sys.write(output);
9898
}

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ module ts {
114114
export function nodePosToString(node: Node): string {
115115
var file = getSourceFileOfNode(node);
116116
var loc = getLineAndCharacterOfPosition(file, node.pos);
117-
return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
117+
return `${ file.fileName }(${ loc.line + 1 },${ loc.character + 1 })`;
118118
}
119119

120120
export function getStartPosOfNode(node: Node): number {

src/harness/fourslash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ module FourSlash {
396396

397397
var lineStarts = ts.computeLineStarts(this.getFileContent(this.activeFile.fileName));
398398
var lineCharPos = ts.computeLineAndCharacterOfPosition(lineStarts, pos);
399-
this.scenarioActions.push('<MoveCaretToLineAndChar LineNumber="' + (lineCharPos.line + 1) + '" CharNumber="' + (lineCharPos.character + 1) + '" />');
399+
this.scenarioActions.push(`<MoveCaretToLineAndChar LineNumber=${ lineCharPos.line + 1 } CharNumber=${ lineCharPos.character + 1 } />`);
400400
}
401401

402402
public moveCaretRight(count = 1) {

0 commit comments

Comments
 (0)