Skip to content

Commit 934da9f

Browse files
author
Andy
authored
Remove template strings in checker.ts (microsoft#18016)
* Remove template strings in checker.ts * Inline function
1 parent a60b103 commit 934da9f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,7 @@ namespace ts {
30863086
}
30873087

30883088
function literalTypeToString(type: LiteralType) {
3089-
return type.flags & TypeFlags.StringLiteral ? `"${escapeString((<StringLiteralType>type).value)}"` : "" + (<NumberLiteralType>type).value;
3089+
return type.flags & TypeFlags.StringLiteral ? '"' + escapeString((<StringLiteralType>type).value) + '"' : "" + (<NumberLiteralType>type).value;
30903090
}
30913091

30923092
function getNameOfSymbol(symbol: Symbol): string {
@@ -6263,7 +6263,7 @@ namespace ts {
62636263
if (isExternalModuleNameRelative(moduleName)) {
62646264
return undefined;
62656265
}
6266-
const symbol = getSymbol(globals, `"${moduleName}"` as __String, SymbolFlags.ValueModule);
6266+
const symbol = getSymbol(globals, '"' + moduleName + '"' as __String, SymbolFlags.ValueModule);
62676267
// merged symbol is module declaration symbol combined with all augmentations
62686268
return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;
62696269
}
@@ -15862,7 +15862,7 @@ namespace ts {
1586215862
min = Math.min(min, getMinTypeArgumentCount(sig.typeParameters));
1586315863
max = Math.max(max, length(sig.typeParameters));
1586415864
}
15865-
const paramCount = min < max ? `${min}-${max}` : min;
15865+
const paramCount = min < max ? min + "-" + max : min;
1586615866
diagnostics.add(createDiagnosticForNode(node, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length));
1586715867
}
1586815868
else if (args) {
@@ -15875,7 +15875,7 @@ namespace ts {
1587515875
const hasRestParameter = some(signatures, sig => sig.hasRestParameter);
1587615876
const hasSpreadArgument = getSpreadArgumentIndex(args) > -1;
1587715877
const paramCount = hasRestParameter ? min :
15878-
min < max ? `${min}-${max}` :
15878+
min < max ? min + "-" + max :
1587915879
min;
1588015880
const argCount = args.length - (hasSpreadArgument ? 1 : 0);
1588115881
const error = hasRestParameter && hasSpreadArgument ? Diagnostics.Expected_at_least_0_arguments_but_got_a_minimum_of_1 :
@@ -25089,7 +25089,7 @@ namespace ts {
2508925089
}
2509025090
if (diagnosticMessage) {
2509125091
const withMinus = isPrefixUnaryExpression(node.parent) && node.parent.operator === SyntaxKind.MinusToken;
25092-
const literal = `${withMinus ? "-" : ""}0o${node.text}`;
25092+
const literal = (withMinus ? "-" : "") + "0o" + node.text;
2509325093
return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal);
2509425094
}
2509525095
}

0 commit comments

Comments
 (0)