diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 07d79f50fe21a..3ad6ce006b034 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -4102,87 +4102,22 @@ namespace ts { * @param node A TemplateExpression node. */ function visitTemplateExpression(node: TemplateExpression): Expression { - const expressions: Expression[] = []; - addTemplateHead(expressions, node); - addTemplateSpans(expressions, node); - - // createAdd will check if each expression binds less closely than binary '+'. - // If it does, it wraps the expression in parentheses. Otherwise, something like - // `abc${ 1 << 2 }` - // becomes - // "abc" + 1 << 2 + "" - // which is really - // ("abc" + 1) << (2 + "") - // rather than - // "abc" + (1 << 2) + "" - const expression = reduceLeft(expressions, factory.createAdd)!; - if (nodeIsSynthesized(expression)) { - setTextRange(expression, node); - } - - return expression; - } - - /** - * Gets a value indicating whether we need to include the head of a TemplateExpression. - * - * @param node A TemplateExpression node. - */ - function shouldAddTemplateHead(node: TemplateExpression) { - // If this expression has an empty head literal and the first template span has a non-empty - // literal, then emitting the empty head literal is not necessary. - // `${ foo } and ${ bar }` - // can be emitted as - // foo + " and " + bar - // This is because it is only required that one of the first two operands in the emit - // output must be a string literal, so that the other operand and all following operands - // are forced into strings. - // - // If the first template span has an empty literal, then the head must still be emitted. - // `${ foo }${ bar }` - // must still be emitted as - // "" + foo + bar - - // There is always atleast one templateSpan in this code path, since - // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral() - Debug.assert(node.templateSpans.length !== 0); + let expression: Expression = factory.createStringLiteral(node.head.text); + for (const span of node.templateSpans) { + const args = [visitNode(span.expression, visitor, isExpression)]; - const span = node.templateSpans[0]; - return node.head.text.length !== 0 || span.literal.text.length === 0 || !!length(getLeadingCommentRangesOfNode(span.expression, currentSourceFile)); - } + if (span.literal.text.length > 0) { + args.push(factory.createStringLiteral(span.literal.text)); + } - /** - * Adds the head of a TemplateExpression to an array of expressions. - * - * @param expressions An array of expressions. - * @param node A TemplateExpression node. - */ - function addTemplateHead(expressions: Expression[], node: TemplateExpression): void { - if (!shouldAddTemplateHead(node)) { - return; + expression = factory.createCallExpression( + factory.createPropertyAccessExpression(expression, "concat"), + /*typeArguments*/ undefined, + args, + ); } - expressions.push(factory.createStringLiteral(node.head.text)); - } - - /** - * Visits and adds the template spans of a TemplateExpression to an array of expressions. - * - * @param expressions An array of expressions. - * @param node A TemplateExpression node. - */ - function addTemplateSpans(expressions: Expression[], node: TemplateExpression): void { - for (const span of node.templateSpans) { - expressions.push(visitNode(span.expression, visitor, isExpression)); - - // Only emit if the literal is non-empty. - // The binary '+' operator is left-associative, so the first string concatenation - // with the head will force the result up to this point to be a string. - // Emitting a '+ ""' has no semantic effect for middles and tails. - if (span.literal.text.length !== 0) { - expressions.push(factory.createStringLiteral(span.literal.text)); - } - } + return setTextRange(expression, node); } /** diff --git a/src/testRunner/tsconfig.json b/src/testRunner/tsconfig.json index 5f9615be944c2..e617b5adc095f 100644 --- a/src/testRunner/tsconfig.json +++ b/src/testRunner/tsconfig.json @@ -100,6 +100,7 @@ "unittests/evaluation/optionalCall.ts", "unittests/evaluation/objectRest.ts", "unittests/evaluation/superInStaticInitializer.ts", + "unittests/evaluation/templateLiteral.ts", "unittests/evaluation/updateExpressionInModule.ts", "unittests/services/cancellableLanguageServiceOperations.ts", "unittests/services/colorization.ts", diff --git a/src/testRunner/unittests/evaluation/templateLiteral.ts b/src/testRunner/unittests/evaluation/templateLiteral.ts new file mode 100644 index 0000000000000..2a4e23ee879d4 --- /dev/null +++ b/src/testRunner/unittests/evaluation/templateLiteral.ts @@ -0,0 +1,40 @@ +describe("unittests:: evaluation:: templateLiteral", () => { + it("toString() over valueOf()", () => { + const result = evaluator.evaluateTypeScript(` + class C { + toString() { + return "toString"; + } + valueOf() { + return "valueOf"; + } + } + + export const output = \`\${new C}\`; + `); + assert.strictEqual(result.output, "toString"); + }); + + it("correct evaluation order", () => { + const result = evaluator.evaluateTypeScript(` + class C { + counter: number; + + constructor() { + this.counter = 0; + } + + get foo() { + this.counter++; + return { + toString: () => this.counter++, + }; + } + } + + const c = new C; + export const output = \`\${c.foo} \${c.foo}\`; + `); + assert.strictEqual(result.output, "1 3"); + }); +}); diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 673dc047fa163..b19bc06d1e63a 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -66,10 +66,10 @@ function compile(fileNames, options) { return; } var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; - console.log(diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); + console.log("".concat(diagnostic.file.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message)); }); var exitCode = emitResult.emitSkipped ? 1 : 0; - console.log("Process exiting with code '" + exitCode + "'."); + console.log("Process exiting with code '".concat(exitCode, "'.")); process.exit(exitCode); } exports.compile = compile; diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index a51c9cde268b7..65e03d339e611 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -114,7 +114,7 @@ function delint(sourceFile) { } function report(node, message) { var _a = sourceFile.getLineAndCharacterOfPosition(node.getStart()), line = _a.line, character = _a.character; - console.log(sourceFile.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); + console.log("".concat(sourceFile.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message)); } } exports.delint = delint; diff --git a/tests/baselines/reference/APISample_parseConfig.js b/tests/baselines/reference/APISample_parseConfig.js index ffd27fdbabbcf..e9dc119417cfe 100644 --- a/tests/baselines/reference/APISample_parseConfig.js +++ b/tests/baselines/reference/APISample_parseConfig.js @@ -56,7 +56,7 @@ function printError(error) { if (!error) { return; } - console.log((error.file && error.file.fileName) + ": " + error.messageText); + console.log("".concat(error.file && error.file.fileName, ": ").concat(error.messageText)); } function createProgram(rootFiles, compilerOptionsJson) { var _a = ts.parseConfigFileTextToJson("tsconfig.json", compilerOptionsJson), config = _a.config, error = _a.error; diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index e93856a31656b..8241222971b20 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -166,10 +166,10 @@ function watch(rootFileNames, options) { function emitFile(fileName) { var output = services.getEmitOutput(fileName); if (!output.emitSkipped) { - console.log("Emitting " + fileName); + console.log("Emitting ".concat(fileName)); } else { - console.log("Emitting " + fileName + " failed"); + console.log("Emitting ".concat(fileName, " failed")); logErrors(fileName); } output.outputFiles.forEach(function (o) { @@ -184,10 +184,10 @@ function watch(rootFileNames, options) { var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); if (diagnostic.file) { var _a = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a.line, character = _a.character; - console.log(" Error " + diagnostic.file.fileName + " (" + (line + 1) + "," + (character + 1) + "): " + message); + console.log(" Error ".concat(diagnostic.file.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message)); } else { - console.log(" Error: " + message); + console.log(" Error: ".concat(message)); } }); } diff --git a/tests/baselines/reference/TemplateExpression1.js b/tests/baselines/reference/TemplateExpression1.js index c4437260084be..6a0f901f0f982 100644 --- a/tests/baselines/reference/TemplateExpression1.js +++ b/tests/baselines/reference/TemplateExpression1.js @@ -2,4 +2,4 @@ var v = `foo ${ a //// [TemplateExpression1.js] -var v = "foo " + a; +var v = "foo ".concat(a); diff --git a/tests/baselines/reference/asOperator3.js b/tests/baselines/reference/asOperator3.js index 7cbb277bb0339..9027237af1db2 100644 --- a/tests/baselines/reference/asOperator3.js +++ b/tests/baselines/reference/asOperator3.js @@ -15,11 +15,11 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; -var a = "" + (123 + 456); -var b = "leading " + (123 + 456); -var c = 123 + 456 + " trailing"; -var d = "Hello " + 123 + " World"; +var a = "".concat(123 + 456); +var b = "leading ".concat(123 + 456); +var c = "".concat(123 + 456, " trailing"); +var d = "Hello ".concat(123, " World"); var e = "Hello"; -var f = 1 + (1 + " end of string"); +var f = 1 + "".concat(1, " end of string"); var g = tag(__makeTemplateObject(["Hello ", " World"], ["Hello ", " World"]), 123); var h = tag(__makeTemplateObject(["Hello"], ["Hello"])); diff --git a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js index bc9c08b552477..b133c6c6ba593 100644 --- a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js +++ b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js @@ -16,7 +16,7 @@ stringIndex[s].toFixed(); // @ts-check var _a, _b; var n = Math.random(); -var s = "" + n; +var s = "".concat(n); var numericIndex = (_a = {}, _a[n] = 1, _a); numericIndex[n].toFixed(); var stringIndex = (_b = {}, _b[s] = 1, _b); diff --git a/tests/baselines/reference/classAttributeInferenceTemplate.js b/tests/baselines/reference/classAttributeInferenceTemplate.js index 24a90d0301a2c..2f5503d72190e 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplate.js +++ b/tests/baselines/reference/classAttributeInferenceTemplate.js @@ -19,8 +19,8 @@ var MyClass = /** @class */ (function () { function MyClass() { var variable = 'something'; this.property = "foo"; // Correctly inferred as `string` - this.property2 = "foo-" + variable; // Causes an error - var localProperty = "foo-" + variable; // Correctly inferred as `string` + this.property2 = "foo-".concat(variable); // Causes an error + var localProperty = "foo-".concat(variable); // Correctly inferred as `string` } return MyClass; }()); diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.js b/tests/baselines/reference/computedPropertyNames10_ES5.js index 01e11d237f1d7..eb277ed2b6b64 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.js +++ b/tests/baselines/reference/computedPropertyNames10_ES5.js @@ -32,5 +32,5 @@ var v = (_a = {}, _a[a] = function () { }, _a[true] = function () { }, _a["hello bye"] = function () { }, - _a["hello " + a + " bye"] = function () { }, + _a["hello ".concat(a, " bye")] = function () { }, _a); diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index 8123ba00c3539..47c6cbb3c9ff9 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -72,7 +72,7 @@ var v = (_a = {}, enumerable: false, configurable: true }), - Object.defineProperty(_a, "hello " + a + " bye", { + Object.defineProperty(_a, "hello ".concat(a, " bye"), { get: function () { return 0; }, enumerable: false, configurable: true diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.js b/tests/baselines/reference/computedPropertyNames12_ES5.js index 0245bfd3b2a05..2050c2c75f125 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.js +++ b/tests/baselines/reference/computedPropertyNames12_ES5.js @@ -27,7 +27,7 @@ var C = /** @class */ (function () { this["hello bye"] = 0; } var _a, _b, _c; - _a = n, s + s, _b = s + n, +s, _c = "hello " + a + " bye"; + _a = n, s + s, _b = s + n, +s, _c = "hello ".concat(a, " bye"); C[_c] = 0; return C; }()); diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.js b/tests/baselines/reference/computedPropertyNames13_ES5.js index f22d55506043b..b23507e36357d 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.js +++ b/tests/baselines/reference/computedPropertyNames13_ES5.js @@ -33,6 +33,6 @@ var C = /** @class */ (function () { C.prototype[a] = function () { }; C[true] = function () { }; C.prototype["hello bye"] = function () { }; - C["hello " + a + " bye"] = function () { }; + C["hello ".concat(a, " bye")] = function () { }; return C; }()); diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.js b/tests/baselines/reference/computedPropertyNames16_ES5.js index 1fec4a6f2eab4..9d7a21520c34c 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.js +++ b/tests/baselines/reference/computedPropertyNames16_ES5.js @@ -73,7 +73,7 @@ var C = /** @class */ (function () { enumerable: false, configurable: true }); - Object.defineProperty(C.prototype, "hello " + a + " bye", { + Object.defineProperty(C.prototype, "hello ".concat(a, " bye"), { get: function () { return 0; }, enumerable: false, configurable: true diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.js b/tests/baselines/reference/computedPropertyNames4_ES5.js index 1c966e63bb56e..58c7b93660d6f 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.js +++ b/tests/baselines/reference/computedPropertyNames4_ES5.js @@ -32,5 +32,5 @@ var v = (_a = {}, _a[a] = 1, _a[true] = 0, _a["hello bye"] = 0, - _a["hello " + a + " bye"] = 0, + _a["hello ".concat(a, " bye")] = 0, _a); diff --git a/tests/baselines/reference/constEnumErrors.js b/tests/baselines/reference/constEnumErrors.js index 3614059d62942..09eee16dcd929 100644 --- a/tests/baselines/reference/constEnumErrors.js +++ b/tests/baselines/reference/constEnumErrors.js @@ -52,7 +52,7 @@ var E; var y0 = E2[1]; var name = "A"; var y1 = E2[name]; -var y2 = E2["" + name]; +var y2 = E2["".concat(name)]; var x = E2; var y = [E2]; function foo(t) { diff --git a/tests/baselines/reference/declarationNoDanglingGenerics.js b/tests/baselines/reference/declarationNoDanglingGenerics.js index 4b97a3abe0bb0..e758b86a46954 100644 --- a/tests/baselines/reference/declarationNoDanglingGenerics.js +++ b/tests/baselines/reference/declarationNoDanglingGenerics.js @@ -54,7 +54,7 @@ exports.CKind = exports.BKind = exports.AKind = void 0; var kindCache = {}; function register(kind) { if (kindCache[kind]) { - throw new Error("Class with kind \"" + kind + "\" is already registered."); + throw new Error("Class with kind \"".concat(kind, "\" is already registered.")); } kindCache[kind] = true; } diff --git a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js index ad434acada16c..fc812b3b67b98 100644 --- a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js +++ b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.js @@ -55,7 +55,7 @@ var Parent = function (_a) { }; var Child = function (_a) { var children = _a.children, _b = _a.name, name = _b === void 0 ? "Artemis" : _b, props = __rest(_a, ["children", "name"]); - return "name: " + name + " props: " + JSON.stringify(props); + return "name: ".concat(name, " props: ").concat(JSON.stringify(props)); }; f(function (_a) { var _1 = _a[0], _b = _a[1], _2 = _b === void 0 ? undefined : _b; diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js index 379af45e0f7c4..65c637a58e1b8 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.js @@ -31,22 +31,22 @@ var t1 = 10; var t2 = 10; var s; // With TemplateTail -Math.pow(t1, -t2) + " world"; -Math.pow((-t1), t2) - t1 + " world"; -Math.pow((-++t1), t2) - t1 + " world"; -Math.pow((-t1++), t2) - t1 + " world"; -Math.pow((~t1), Math.pow(t2, --t1)) + " world"; -typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; +"".concat(Math.pow(t1, -t2), " world"); +"".concat(Math.pow((-t1), t2) - t1, " world"); +"".concat(Math.pow((-++t1), t2) - t1, " world"); +"".concat(Math.pow((-t1++), t2) - t1, " world"); +"".concat(Math.pow((~t1), Math.pow(t2, --t1)), " world"); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " world"); // TempateHead & TemplateTail are empt -Math.pow(t1, -t2) + " hello world " + Math.pow(t1, -t2); -Math.pow((-t1), t2) - t1 + " hello world " + (Math.pow((-t1), t2) - t1); -Math.pow((-++t1), t2) - t1 + " hello world " + Math.pow(t1, Math.pow((-++t1), -t1)); -Math.pow((-t1++), t2) - t1 + " hello world " + Math.pow(t2, Math.pow((-t1++), -t1)); -Math.pow((~t1), Math.pow(t2, --t1)) + " hello world " + Math.pow((~t1), Math.pow(t2, --t1)); -typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); +"".concat(Math.pow(t1, -t2), " hello world ").concat(Math.pow(t1, -t2)); +"".concat(Math.pow((-t1), t2) - t1, " hello world ").concat(Math.pow((-t1), t2) - t1); +"".concat(Math.pow((-++t1), t2) - t1, " hello world ").concat(Math.pow(t1, Math.pow((-++t1), -t1))); +"".concat(Math.pow((-t1++), t2) - t1, " hello world ").concat(Math.pow(t2, Math.pow((-t1++), -t1))); +"".concat(Math.pow((~t1), Math.pow(t2, --t1)), " hello world ").concat(Math.pow((~t1), Math.pow(t2, --t1))); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " hello world ").concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); // With templateHead -"hello " + (Math.pow((-t1), t2) - t1); -"hello " + (Math.pow((-++t1), t2) - t1); -"hello " + (Math.pow((-t1++), t2) - t1); -"hello " + Math.pow((~t1), Math.pow(t2, --t1)); -"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))); +"hello ".concat(Math.pow((-t1), t2) - t1); +"hello ".concat(Math.pow((-++t1), t2) - t1); +"hello ".concat(Math.pow((-t1++), t2) - t1); +"hello ".concat(Math.pow((~t1), Math.pow(t2, --t1))); +"hello ".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js index dbfd59871561d..3af187a1ea26f 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.js @@ -31,22 +31,22 @@ var t1 = 10; var t2 = 10; var s; // TempateHead & TemplateTail are empty -"" + Math.pow(t1, t2); -"" + Math.pow(t1, Math.pow(t2, t1)); -"" + (t1 + Math.pow(t2, t1)); -"" + (Math.pow(t1, t2) + t1); -"" + (t1 + Math.pow(t2, t2) + t1); -"" + typeof (Math.pow(t1, Math.pow(t2, t1))); -"" + (1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); -"" + Math.pow(t1, t2) + Math.pow(t1, t2); -"" + Math.pow(t1, Math.pow(t2, t1)) + Math.pow(t1, Math.pow(t2, t1)); -"" + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)); -"" + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1); -"" + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1); -"" + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))); -Math.pow(t1, t2) + " hello world " + Math.pow(t1, t2); -Math.pow(t1, Math.pow(t2, t1)) + " hello world " + Math.pow(t1, Math.pow(t2, t1)); -t1 + Math.pow(t2, t1) + " hello world " + (t1 + Math.pow(t2, t1)); -Math.pow(t1, t2) + t1 + " hello world " + (Math.pow(t1, t2) + t1); -t1 + Math.pow(t2, t2) + t1 + " hello world " + (t1 + Math.pow(t2, t2) + t1); -typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); +"".concat(Math.pow(t1, t2)); +"".concat(Math.pow(t1, Math.pow(t2, t1))); +"".concat(t1 + Math.pow(t2, t1)); +"".concat(Math.pow(t1, t2) + t1); +"".concat(t1 + Math.pow(t2, t2) + t1); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); +"".concat(1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); +"".concat(Math.pow(t1, t2)).concat(Math.pow(t1, t2)); +"".concat(Math.pow(t1, Math.pow(t2, t1))).concat(Math.pow(t1, Math.pow(t2, t1))); +"".concat(t1 + Math.pow(t2, t1)).concat(t1 + Math.pow(t2, t1)); +"".concat(Math.pow(t1, t2) + t1).concat(Math.pow(t1, t2) + t1); +"".concat(t1 + Math.pow(t2, t2) + t1).concat(t1 + Math.pow(t2, t2) + t1); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))).concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); +"".concat(Math.pow(t1, t2), " hello world ").concat(Math.pow(t1, t2)); +"".concat(Math.pow(t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(t1, Math.pow(t2, t1))); +"".concat(t1 + Math.pow(t2, t1), " hello world ").concat(t1 + Math.pow(t2, t1)); +"".concat(Math.pow(t1, t2) + t1, " hello world ").concat(Math.pow(t1, t2) + t1); +"".concat(t1 + Math.pow(t2, t2) + t1, " hello world ").concat(t1 + Math.pow(t2, t2) + t1); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " hello world ").concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js index 93604d0e00fb3..dea48731c6b20 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.js @@ -31,22 +31,22 @@ var t1 = 10; var t2 = 10; var s; // With templateHead -"hello " + Math.pow(t1, t2); -"hello " + Math.pow(t1, Math.pow(t2, t1)); -"hello " + (t1 + Math.pow(t2, t1)); -"hello " + (Math.pow(t1, t2) + t1); -"hello " + (t1 + Math.pow(t2, t2) + t1); -"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))); -"hello " + (1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); -"hello " + Math.pow(t1, t2) + Math.pow(t1, t2); -"hello " + Math.pow(t1, Math.pow(t2, t1)) + Math.pow(t1, Math.pow(t2, t1)); -"hello " + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)); -"hello " + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1); -"hello " + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1); -"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))); -"hello " + Math.pow(t1, t2) + " hello world " + Math.pow(t1, t2); -"hello " + Math.pow(t1, Math.pow(t2, t1)) + " hello world " + Math.pow(t1, Math.pow(t2, t1)); -"hello " + (t1 + Math.pow(t2, t1)) + " hello world " + (t1 + Math.pow(t2, t1)); -"hello " + (Math.pow(t1, t2) + t1) + " hello world " + (Math.pow(t1, t2) + t1); -"hello " + (t1 + Math.pow(t2, t2) + t1) + " hello world " + (t1 + Math.pow(t2, t2) + t1); -"hello " + typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))); +"hello ".concat(Math.pow(t1, t2)); +"hello ".concat(Math.pow(t1, Math.pow(t2, t1))); +"hello ".concat(t1 + Math.pow(t2, t1)); +"hello ".concat(Math.pow(t1, t2) + t1); +"hello ".concat(t1 + Math.pow(t2, t2) + t1); +"hello ".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); +"hello ".concat(1 + typeof (Math.pow(t1, Math.pow(t2, t1)))); +"hello ".concat(Math.pow(t1, t2)).concat(Math.pow(t1, t2)); +"hello ".concat(Math.pow(t1, Math.pow(t2, t1))).concat(Math.pow(t1, Math.pow(t2, t1))); +"hello ".concat(t1 + Math.pow(t2, t1)).concat(t1 + Math.pow(t2, t1)); +"hello ".concat(Math.pow(t1, t2) + t1).concat(Math.pow(t1, t2) + t1); +"hello ".concat(t1 + Math.pow(t2, t2) + t1).concat(t1 + Math.pow(t2, t2) + t1); +"hello ".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))).concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); +"hello ".concat(Math.pow(t1, t2), " hello world ").concat(Math.pow(t1, t2)); +"hello ".concat(Math.pow(t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(t1, Math.pow(t2, t1))); +"hello ".concat(t1 + Math.pow(t2, t1), " hello world ").concat(t1 + Math.pow(t2, t1)); +"hello ".concat(Math.pow(t1, t2) + t1, " hello world ").concat(Math.pow(t1, t2) + t1); +"hello ".concat(t1 + Math.pow(t2, t2) + t1, " hello world ").concat(t1 + Math.pow(t2, t2) + t1); +"hello ".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " hello world ").concat(typeof (Math.pow(t1, Math.pow(t2, t1)))); diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js index 93333a3a8df2d..ffd4a0bb2087f 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.js @@ -32,22 +32,22 @@ var t1 = 10; var t2 = 10; var s; // With TemplateTail -Math.pow(t1, t2) + " world"; -Math.pow(t1, Math.pow(t2, t1)) + " world"; -t1 + Math.pow(t2, t1) + " world"; -Math.pow(t1, t2) + t1 + " world"; -t1 + Math.pow(t2, t2) + t1 + " world"; -typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; -1 + typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; -"" + Math.pow(t1, t2) + Math.pow(t1, t2) + " world"; -"" + Math.pow(t1, Math.pow(t2, t1)) + Math.pow(t1, Math.pow(t2, t1)) + " world"; -"" + (t1 + Math.pow(t2, t1)) + (t1 + Math.pow(t2, t1)) + " world"; -"" + (Math.pow(t1, t2) + t1) + (Math.pow(t1, t2) + t1) + " world"; -"" + (t1 + Math.pow(t2, t2) + t1) + (t1 + Math.pow(t2, t2) + t1) + " world"; -"" + typeof (Math.pow(t1, Math.pow(t2, t1))) + typeof (Math.pow(t1, Math.pow(t2, t1))) + " world"; -Math.pow(t1, t2) + " hello world " + Math.pow(t1, t2) + " !!"; -Math.pow(t1, Math.pow(t2, t1)) + " hello world " + Math.pow(t1, Math.pow(t2, t1)) + " !!"; -t1 + Math.pow(t2, t1) + " hello world " + (t1 + Math.pow(t2, t1)) + " !!"; -Math.pow(t1, t2) + t1 + " hello world " + (Math.pow(t1, t2) + t1) + " !!"; -t1 + Math.pow(t2, t2) + t1 + " hello world " + (t1 + Math.pow(t2, t2) + t1) + " !!"; -typeof (Math.pow(t1, Math.pow(t2, t1))) + " hello world " + typeof (Math.pow(t1, Math.pow(t2, t1))) + " !!"; +"".concat(Math.pow(t1, t2), " world"); +"".concat(Math.pow(t1, Math.pow(t2, t1)), " world"); +"".concat(t1 + Math.pow(t2, t1), " world"); +"".concat(Math.pow(t1, t2) + t1, " world"); +"".concat(t1 + Math.pow(t2, t2) + t1, " world"); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " world"); +"".concat(1 + typeof (Math.pow(t1, Math.pow(t2, t1))), " world"); +"".concat(Math.pow(t1, t2)).concat(Math.pow(t1, t2), " world"); +"".concat(Math.pow(t1, Math.pow(t2, t1))).concat(Math.pow(t1, Math.pow(t2, t1)), " world"); +"".concat(t1 + Math.pow(t2, t1)).concat(t1 + Math.pow(t2, t1), " world"); +"".concat(Math.pow(t1, t2) + t1).concat(Math.pow(t1, t2) + t1, " world"); +"".concat(t1 + Math.pow(t2, t2) + t1).concat(t1 + Math.pow(t2, t2) + t1, " world"); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1)))).concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " world"); +"".concat(Math.pow(t1, t2), " hello world ").concat(Math.pow(t1, t2), " !!"); +"".concat(Math.pow(t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(t1, Math.pow(t2, t1)), " !!"); +"".concat(t1 + Math.pow(t2, t1), " hello world ").concat(t1 + Math.pow(t2, t1), " !!"); +"".concat(Math.pow(t1, t2) + t1, " hello world ").concat(Math.pow(t1, t2) + t1, " !!"); +"".concat(t1 + Math.pow(t2, t2) + t1, " hello world ").concat(t1 + Math.pow(t2, t2) + t1, " !!"); +"".concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " hello world ").concat(typeof (Math.pow(t1, Math.pow(t2, t1))), " !!"); diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js index 8a793b4e780cf..6ba3fdc9ee558 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.js @@ -32,21 +32,21 @@ var t2 = 10; var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // TempateHead & TemplateTail are empty -"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); -"" + (Math.pow(-t1, t2) - t1); -"" + (Math.pow(-++t1, t2) - t1); -"" + (Math.pow(-t1++, t2) - t1); -"" + Math.pow(!t1, Math.pow(t2, --t1)); -"" + Math.pow(typeof t1, Math.pow(t2, t1)); -"" + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1); -"" + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1); -"" + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1); -"" + Math.pow(!t1, Math.pow(t2, --t1)) + Math.pow(!t1, Math.pow(t2, --t1)); -"" + Math.pow(typeof t1, Math.pow(t2, t1)) + Math.pow(typeof t1, Math.pow(t2, t1)); -"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); -Math.pow(-t1, t2) - t1 + " hello world " + (Math.pow(-t1, t2) - t1); -Math.pow(-++t1, t2) - t1 + " hello world " + (Math.pow(-++t1, t2) - t1); -Math.pow(-t1++, t2) - t1 + " hello world " + (Math.pow(-t1++, t2) - t1); -Math.pow(!t1, Math.pow(t2, --t1)) + " hello world " + Math.pow(!t1, Math.pow(t2, --t1)); -Math.pow(typeof t1, Math.pow(t2, t1)) + " hello world " + Math.pow(typeof t1, Math.pow(t2, t1)); -1 + Math.pow(typeof t1, Math.pow(t2, t1)) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(Math.pow(-t1, t2) - t1); +"".concat(Math.pow(-++t1, t2) - t1); +"".concat(Math.pow(-t1++, t2) - t1); +"".concat(Math.pow(!t1, Math.pow(t2, --t1))); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(Math.pow(-t1, t2) - t1).concat(Math.pow(-t1, t2) - t1); +"".concat(Math.pow(-++t1, t2) - t1).concat(Math.pow(-++t1, t2) - t1); +"".concat(Math.pow(-t1++, t2) - t1).concat(Math.pow(-t1++, t2) - t1); +"".concat(Math.pow(!t1, Math.pow(t2, --t1))).concat(Math.pow(!t1, Math.pow(t2, --t1))); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1))).concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))).concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(Math.pow(-t1, t2) - t1, " hello world ").concat(Math.pow(-t1, t2) - t1); +"".concat(Math.pow(-++t1, t2) - t1, " hello world ").concat(Math.pow(-++t1, t2) - t1); +"".concat(Math.pow(-t1++, t2) - t1, " hello world ").concat(Math.pow(-t1++, t2) - t1); +"".concat(Math.pow(!t1, Math.pow(t2, --t1)), " hello world ").concat(Math.pow(!t1, Math.pow(t2, --t1))); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js index cf8bcfd698fe4..478603923f9c2 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.js @@ -33,21 +33,21 @@ var t2 = 10; var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With templateHead -"hello " + (Math.pow(-t1, t2) - t1); -"hello " + (Math.pow(-++t1, t2) - t1); -"hello " + (Math.pow(-t1++, t2) - t1); -"hello " + Math.pow(!t1, Math.pow(t2, --t1)); -"hello " + Math.pow(typeof t1, Math.pow(t2, t1)); -"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); -"hello " + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1); -"hello " + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1); -"hello " + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1); -"hello " + Math.pow(!t1, Math.pow(t2, --t1)) + Math.pow(!t1, Math.pow(t2, --t1)); -"hello " + Math.pow(typeof t1, Math.pow(t2, t1)) + Math.pow(typeof t1, Math.pow(t2, t1)); -"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); -"hello " + (Math.pow(-t1, t2) - t1) + " hello world " + (Math.pow(-t1, t2) - t1); -"hello " + (Math.pow(-++t1, t2) - t1) + " hello world " + (Math.pow(-++t1, t2) - t1); -"hello " + (Math.pow(-t1++, t2) - t1) + " hello world " + (Math.pow(-t1++, t2) - t1); -"hello " + Math.pow(!t1, Math.pow(t2, --t1)) + " hello world " + Math.pow(!t1, Math.pow(t2, --t1)); -"hello " + Math.pow(typeof t1, Math.pow(t2, t1)) + " hello world " + Math.pow(typeof t1, Math.pow(t2, t1)); -"hello " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(Math.pow(-t1, t2) - t1); +"hello ".concat(Math.pow(-++t1, t2) - t1); +"hello ".concat(Math.pow(-t1++, t2) - t1); +"hello ".concat(Math.pow(!t1, Math.pow(t2, --t1))); +"hello ".concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(Math.pow(-t1, t2) - t1).concat(Math.pow(-t1, t2) - t1); +"hello ".concat(Math.pow(-++t1, t2) - t1).concat(Math.pow(-++t1, t2) - t1); +"hello ".concat(Math.pow(-t1++, t2) - t1).concat(Math.pow(-t1++, t2) - t1); +"hello ".concat(Math.pow(!t1, Math.pow(t2, --t1))).concat(Math.pow(!t1, Math.pow(t2, --t1))); +"hello ".concat(Math.pow(typeof t1, Math.pow(t2, t1))).concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))).concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(Math.pow(-t1, t2) - t1, " hello world ").concat(Math.pow(-t1, t2) - t1); +"hello ".concat(Math.pow(-++t1, t2) - t1, " hello world ").concat(Math.pow(-++t1, t2) - t1); +"hello ".concat(Math.pow(-t1++, t2) - t1, " hello world ").concat(Math.pow(-t1++, t2) - t1); +"hello ".concat(Math.pow(!t1, Math.pow(t2, --t1)), " hello world ").concat(Math.pow(!t1, Math.pow(t2, --t1))); +"hello ".concat(Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(typeof t1, Math.pow(t2, t1))); +"hello ".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))); diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js index bb203db9144a7..0324a2124b2cd 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.js @@ -32,21 +32,21 @@ var t2 = 10; var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With TemplateTail -Math.pow(-t1, t2) - t1 + " world"; -Math.pow(-++t1, t2) - t1 + " world"; -Math.pow(-t1++, t2) - t1 + " world"; -Math.pow(!t1, Math.pow(t2, --t1)) + " world"; -Math.pow(typeof t1, Math.pow(t2, t1)) + " world"; -1 + Math.pow(typeof t1, Math.pow(t2, t1)) + " world"; -"" + (Math.pow(-t1, t2) - t1) + (Math.pow(-t1, t2) - t1) + " world"; -"" + (Math.pow(-++t1, t2) - t1) + (Math.pow(-++t1, t2) - t1) + " world"; -"" + (Math.pow(-t1++, t2) - t1) + (Math.pow(-t1++, t2) - t1) + " world"; -"" + Math.pow(!t1, Math.pow(t2, --t1)) + Math.pow(!t1, Math.pow(t2, --t1)) + " world"; -"" + Math.pow(typeof t1, Math.pow(t2, t1)) + Math.pow(typeof t1, Math.pow(t2, t1)) + " world"; -"" + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " world"; -Math.pow(-t1, t2) - t1 + " hello world " + (Math.pow(-t1, t2) - t1) + " !!"; -Math.pow(-++t1, t2) - t1 + " hello world " + (Math.pow(-++t1, t2) - t1) + " !!"; -Math.pow(-t1++, t2) - t1 + " hello world " + (Math.pow(-t1++, t2) - t1) + " !!"; -Math.pow(!t1, Math.pow(t2, --t1)) + " hello world " + Math.pow(!t1, Math.pow(t2, --t1)) + " !!"; -Math.pow(typeof t1, Math.pow(t2, t1)) + " hello world " + Math.pow(typeof t1, Math.pow(t2, t1)) + " !!"; -1 + Math.pow(typeof t1, Math.pow(t2, t1)) + " hello world " + (1 + Math.pow(typeof t1, Math.pow(t2, t1))) + " !!"; +"".concat(Math.pow(-t1, t2) - t1, " world"); +"".concat(Math.pow(-++t1, t2) - t1, " world"); +"".concat(Math.pow(-t1++, t2) - t1, " world"); +"".concat(Math.pow(!t1, Math.pow(t2, --t1)), " world"); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1)), " world"); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " world"); +"".concat(Math.pow(-t1, t2) - t1).concat(Math.pow(-t1, t2) - t1, " world"); +"".concat(Math.pow(-++t1, t2) - t1).concat(Math.pow(-++t1, t2) - t1, " world"); +"".concat(Math.pow(-t1++, t2) - t1).concat(Math.pow(-t1++, t2) - t1, " world"); +"".concat(Math.pow(!t1, Math.pow(t2, --t1))).concat(Math.pow(!t1, Math.pow(t2, --t1)), " world"); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1))).concat(Math.pow(typeof t1, Math.pow(t2, t1)), " world"); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1))).concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " world"); +"".concat(Math.pow(-t1, t2) - t1, " hello world ").concat(Math.pow(-t1, t2) - t1, " !!"); +"".concat(Math.pow(-++t1, t2) - t1, " hello world ").concat(Math.pow(-++t1, t2) - t1, " !!"); +"".concat(Math.pow(-t1++, t2) - t1, " hello world ").concat(Math.pow(-t1++, t2) - t1, " !!"); +"".concat(Math.pow(!t1, Math.pow(t2, --t1)), " hello world ").concat(Math.pow(!t1, Math.pow(t2, --t1)), " !!"); +"".concat(Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(Math.pow(typeof t1, Math.pow(t2, t1)), " !!"); +"".concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " hello world ").concat(1 + Math.pow(typeof t1, Math.pow(t2, t1)), " !!"); diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js index 530a106d09db1..0bf4330b42857 100644 --- a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.js @@ -18,16 +18,16 @@ k **= `2${ 3 }4`; //// [exponentiationOperatorWithTemplateStringInvalid.js] -var a = Math.pow(1, "" + 3); -var b = Math.pow(1, "2" + 3); -var c = Math.pow(1, 3 + "4"); -var d = Math.pow(1, "2" + 3 + "4"); -var e = Math.pow("" + 3, 5); -var f = Math.pow("2" + 3, 5); -var g = Math.pow(3 + "4", 5); -var h = Math.pow("2" + 3 + "4", 5); +var a = Math.pow(1, "".concat(3)); +var b = Math.pow(1, "2".concat(3)); +var c = Math.pow(1, "".concat(3, "4")); +var d = Math.pow(1, "2".concat(3, "4")); +var e = Math.pow("".concat(3), 5); +var f = Math.pow("2".concat(3), 5); +var g = Math.pow("".concat(3, "4"), 5); +var h = Math.pow("2".concat(3, "4"), 5); var k = 10; -k = Math.pow(k, "" + 3); -k = Math.pow(k, "2" + 3); -k = Math.pow(k, "2" + 3 + "4"); -k = Math.pow(k, "2" + 3 + "4"); +k = Math.pow(k, "".concat(3)); +k = Math.pow(k, "2".concat(3)); +k = Math.pow(k, "2".concat(3, "4")); +k = Math.pow(k, "2".concat(3, "4")); diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js index 6e0c375edb21a..b980ba0304d20 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js @@ -40,7 +40,7 @@ function tag(str) { var a = tag(__makeTemplateObject(["123"], ["123"])); var b = tag(__makeTemplateObject(["123 ", ""], ["123 ", ""]), 100); var x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); -var y = "hello} " + 100 + " traordinary " + 200 + " wonderful " + 300 + " world"; // should error with NoSubstitutionTemplate +var y = "hello} ".concat(100, " traordinary ").concat(200, " wonderful ").concat(300, " world"); // should error with NoSubstitutionTemplate var z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate var a1 = tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 100); // \0 var a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 diff --git a/tests/baselines/reference/jsDeclarationsExportedClassAliases.js b/tests/baselines/reference/jsDeclarationsExportedClassAliases.js index aaf4bf08165bd..3a79339339c98 100644 --- a/tests/baselines/reference/jsDeclarationsExportedClassAliases.js +++ b/tests/baselines/reference/jsDeclarationsExportedClassAliases.js @@ -38,7 +38,7 @@ var __extends = (this && this.__extends) || (function () { var FancyError = /** @class */ (function (_super) { __extends(FancyError, _super); function FancyError(status) { - return _super.call(this, "error with status " + status) || this; + return _super.call(this, "error with status ".concat(status)) || this; } return FancyError; }(Error)); diff --git a/tests/baselines/reference/noImplicitSymbolToString.js b/tests/baselines/reference/noImplicitSymbolToString.js index 836d5abe8a9d8..fed276b8a731e 100644 --- a/tests/baselines/reference/noImplicitSymbolToString.js +++ b/tests/baselines/reference/noImplicitSymbolToString.js @@ -18,9 +18,9 @@ const templateStrUnion = `union with number ${symbolUnionNumber} and union with // Fix #19666 var symbol; var str = "hello "; -var templateStr = "hello " + symbol; +var templateStr = "hello ".concat(symbol); var appendStr = "hello " + symbol; str += symbol; var symbolUnionNumber; var symbolUnionString; -var templateStrUnion = "union with number " + symbolUnionNumber + " and union with string " + symbolUnionString; +var templateStrUnion = "union with number ".concat(symbolUnionNumber, " and union with string ").concat(symbolUnionString); diff --git a/tests/baselines/reference/recursiveTypeReferences1.js b/tests/baselines/reference/recursiveTypeReferences1.js index 30e09450be4a7..744c9c57b5cd0 100644 --- a/tests/baselines/reference/recursiveTypeReferences1.js +++ b/tests/baselines/reference/recursiveTypeReferences1.js @@ -191,7 +191,7 @@ function parse(node, index) { var el = _a[0], children = _a[1]; var idx = __spreadArray(__spreadArray([], index, true), [i + 1], false); return html('li', [ - html('a', { href: "#" + el.id, rel: 'noopener', 'data-index': idx.join('.') }, el.textContent), + html('a', { href: "#".concat(el.id), rel: 'noopener', 'data-index': idx.join('.') }, el.textContent), children.length > 0 ? parse(children, idx) : frag() ]); })); diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js index 8d675eeb9c40d..8a34efbb267c8 100644 --- a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.js @@ -5,7 +5,7 @@ let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; //// [stringLiteralTypesWithTemplateStrings02.js] var abc = "AB\nC"; -var de_NEWLINE_f = "DE" + "\n" + "F"; +var de_NEWLINE_f = "DE".concat("\n", "F"); //// [stringLiteralTypesWithTemplateStrings02.d.ts] diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.js b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.js index 159181febc1c9..124dd7b381b09 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.js +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.js @@ -2,4 +2,4 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` //// [taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.js] -"0" + " " + "1" + " " + "2" + " " + "3" + " " + "4" + " " + "5" + " " + "6" + " " + "7" + " " + "8" + " " + "9" + " " + "10" + " " + "11" + " " + "12" + " " + "13" + " " + "14" + " " + "15" + " " + "16" + " " + "17" + " " + "18" + " " + "19" + " " + "20" + " " + "2028" + " " + "2029" + " " + "0085" + " " + "t" + " " + "v" + " " + "f" + " " + "b" + " " + "r" + " " + "n"; +"0".concat(" ", "1").concat(" ", "2").concat(" ", "3").concat(" ", "4").concat(" ", "5").concat(" ", "6").concat(" ", "7").concat(" ", "8").concat(" ", "9").concat(" ", "10").concat(" ", "11").concat(" ", "12").concat(" ", "13").concat(" ", "14").concat(" ", "15").concat(" ", "16").concat(" ", "17").concat(" ", "18").concat(" ", "19").concat(" ", "20").concat(" ", "2028").concat(" ", "2029").concat(" ", "0085").concat(" ", "t").concat(" ", "v").concat(" ", "f").concat(" ", "b").concat(" ", "r").concat(" ", "n"); diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.js b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.js index 4e0c70e837a83..b90c922e28974 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.js +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.js @@ -49,4 +49,4 @@ f(__makeTemplateObject(["abc"], ["abc"]))[0].member(__makeTemplateObject(["abc", f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2)["member"].member(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), true, true)["member"].member(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f.thisIsNotATag("abc"); -f.thisIsNotATag("abc" + 1 + "def" + 2 + "ghi"); +f.thisIsNotATag("abc".concat(1, "def").concat(2, "ghi")); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.js b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.js index af9fd2c9d443e..b374e406ce24b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.js +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.js @@ -42,4 +42,4 @@ f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2)["mem f(__makeTemplateObject(["abc"], ["abc"]))["member"].someOtherTag(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2)["member"].someOtherTag(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f.thisIsNotATag("abc"); -f.thisIsNotATag("abc" + 1 + "def" + 2 + "ghi"); +f.thisIsNotATag("abc".concat(1, "def").concat(2, "ghi")); diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.js b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.js index c6509f1ca8676..af262aa1ac198 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.js +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.js @@ -46,4 +46,4 @@ f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2)["mem f(__makeTemplateObject(["abc"], ["abc"]))[0].member(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2)["member"].member(__makeTemplateObject(["abc", "def", "ghi"], ["abc", "def", "ghi"]), 1, 2); f.thisIsNotATag("abc"); -f.thisIsNotATag("abc" + 1 + "def" + 2 + "ghi"); +f.thisIsNotATag("abc".concat(1, "def").concat(2, "ghi")); diff --git a/tests/baselines/reference/templateLiteralTypes1.js b/tests/baselines/reference/templateLiteralTypes1.js index 5f93208af2fa2..b8f7d0f406667 100644 --- a/tests/baselines/reference/templateLiteralTypes1.js +++ b/tests/baselines/reference/templateLiteralTypes1.js @@ -240,7 +240,7 @@ let make = getProp2(obj2, 'cars.1.make'); // 'Trabant' //// [templateLiteralTypes1.js] "use strict"; // Template types example from #12754 -var createScopedActionType = function (scope) { return function (type) { return scope + "/" + type; }; }; +var createScopedActionType = function (scope) { return function (type) { return "".concat(scope, "/").concat(type); }; }; var createActionInMyScope = createScopedActionType("MyScope"); // (type: T) => `MyScope/${T}` var MY_ACTION = createActionInMyScope("MY_ACTION"); // 'MyScope/MY_ACTION' // Assignability diff --git a/tests/baselines/reference/templateLiteralTypes2.js b/tests/baselines/reference/templateLiteralTypes2.js index 37c101be26923..1b31f3a00ee29 100644 --- a/tests/baselines/reference/templateLiteralTypes2.js +++ b/tests/baselines/reference/templateLiteralTypes2.js @@ -122,33 +122,33 @@ C2(`rotate(${interpolatedStyle.rotate}dig)`); //// [templateLiteralTypes2.js] "use strict"; function ft1(s, n, u, t) { - var c1 = "abc" + s; // `abc${string}` - var c2 = "abc" + n; // `abc${number}` - var c3 = "abc" + u; // "abcfoo" | "abcbar" | "abcbaz" - var c4 = "abc" + t; // `abc${T} - var d1 = "abc" + s; - var d2 = "abc" + n; - var d3 = "abc" + u; - var d4 = "abc" + t; + var c1 = "abc".concat(s); // `abc${string}` + var c2 = "abc".concat(n); // `abc${number}` + var c3 = "abc".concat(u); // "abcfoo" | "abcbar" | "abcbaz" + var c4 = "abc".concat(t); // `abc${T} + var d1 = "abc".concat(s); + var d2 = "abc".concat(n); + var d3 = "abc".concat(u); + var d4 = "abc".concat(t); } function ft2(s) { - return "abc" + s; + return "abc".concat(s); } function ft10(s) { - var c1 = "abc" + s; // Widening type `abc${string}` + var c1 = "abc".concat(s); // Widening type `abc${string}` var v1 = c1; // Type string var c2 = c1; // Widening type `abc${string}` var v2 = c2; // Type string - var c3 = "abc" + s; + var c3 = "abc".concat(s); var v3 = c3; // Type `abc${string}` var c4 = c1; // Type `abc${string}` var v4 = c4; // Type `abc${string}` } function ft11(s, cond) { - var c1 = cond ? "foo" + s : "bar" + s; // widening `foo${string}` | widening `bar${string}` + var c1 = cond ? "foo".concat(s) : "bar".concat(s); // widening `foo${string}` | widening `bar${string}` var c2 = c1; // `foo${string}` | `bar${string}` var c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` - var c4 = cond ? c3 : "baz" + s; // `foo${string}` | `bar${string}` | widening `baz${string}` + var c4 = cond ? c3 : "baz".concat(s); // `foo${string}` | `bar${string}` | widening `baz${string}` var c5 = c4; // `foo${string}` | `bar${string}` | `baz${string}` var v1 = c1; // string var v2 = c2; // `foo${string}` | `bar${string}` @@ -157,22 +157,22 @@ function ft11(s, cond) { var v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` } function ft12(s) { - var c1 = "foo" + s; + var c1 = "foo".concat(s); var v1 = c1; - var c2 = "foo" + s; + var c2 = "foo".concat(s); var v2 = c2; - var c3 = "foo" + s; + var c3 = "foo".concat(s); var v3 = c3; - var c4 = "foo" + s; + var c4 = "foo".concat(s); var v4 = c4; - var c5 = "foo" + s; + var c5 = "foo".concat(s); var v5 = c5; } function ft13(s, cond) { - var x1 = widening("foo" + s); - var x2 = widening(cond ? 'a' : "foo" + s); - var y1 = nonWidening("foo" + s); - var y2 = nonWidening(cond ? 'a' : "foo" + s); + var x1 = widening("foo".concat(s)); + var x2 = widening(cond ? 'a' : "foo".concat(s)); + var y1 = nonWidening("foo".concat(s)); + var y2 = nonWidening(cond ? 'a' : "foo".concat(s)); } function ft14(t) { var x1 = t; @@ -182,28 +182,28 @@ function ft14(t) { var x6 = t; } function ft20(s) { - var x1 = g1("xyz-" + s); // string - var x2 = g2("xyz-" + s); // `xyz-${string}` + var x1 = g1("xyz-".concat(s)); // string + var x2 = g2("xyz-".concat(s)); // `xyz-${string}` } var t1 = takesLiteral("foo.bar.baz"); // "baz" var id2 = "foo.bar.baz"; var t2 = takesLiteral(id2); // "baz" -var t3 = takesLiteral("foo.bar." + someString); // string -var id4 = "foo.bar." + someString; +var t3 = takesLiteral("foo.bar.".concat(someString)); // string +var id4 = "foo.bar.".concat(someString); var t4 = takesLiteral(id4); // string -var t5 = takesLiteral("foo.bar." + someUnion); // "abc" | "def" | "ghi" +var t5 = takesLiteral("foo.bar.".concat(someUnion)); // "abc" | "def" | "ghi" // Repro from #41732 var pixelValue = 22; var pixelString = "22px"; -var pixelStringWithTemplate = pixelValue + "px"; +var pixelStringWithTemplate = "".concat(pixelValue, "px"); // Repro from #43143 function getCardTitle(title) { - return "test-" + title; + return "test-".concat(title); } // Repro from #43424 var interpolatedStyle = { rotate: 12 }; function C2(transform) { return 12; } -C2("rotate(" + interpolatedStyle.rotate + "dig)"); +C2("rotate(".concat(interpolatedStyle.rotate, "dig)")); //// [templateLiteralTypes2.d.ts] diff --git a/tests/baselines/reference/templateLiteralTypes3.js b/tests/baselines/reference/templateLiteralTypes3.js index 7122f13da6dad..fc2df68a400f2 100644 --- a/tests/baselines/reference/templateLiteralTypes3.js +++ b/tests/baselines/reference/templateLiteralTypes3.js @@ -179,11 +179,11 @@ function f1(s, n, b, t) { var x1 = foo1('hello'); // Error var x2 = foo1('*hello*'); var x3 = foo1('**hello**'); - var x4 = foo1("*" + s + "*"); - var x5 = foo1("*" + n + "*"); - var x6 = foo1("*" + b + "*"); - var x7 = foo1("*" + t + "*"); - var x8 = foo1("**" + s + "**"); + var x4 = foo1("*".concat(s, "*")); + var x5 = foo1("*".concat(n, "*")); + var x6 = foo1("*".concat(b, "*")); + var x7 = foo1("*".concat(t, "*")); + var x8 = foo1("**".concat(s, "**")); } function f2() { var x; @@ -201,27 +201,27 @@ function f3(s, n, b, t) { x = 'hello'; // Error x = '*hello*'; x = '**hello**'; - x = "*" + s + "*"; - x = "*" + n + "*"; - x = "*" + b + "*"; - x = "*" + t + "*"; - x = "**" + s + "**"; + x = "*".concat(s, "*"); + x = "*".concat(n, "*"); + x = "*".concat(b, "*"); + x = "*".concat(t, "*"); + x = "**".concat(s, "**"); } function f4(s, n, b, t) { var x; x = '123'; // Error x = '*123*'; x = '**123**'; // Error - x = "*" + s + "*"; // Error - x = "*" + n + "*"; - x = "*" + b + "*"; // Error - x = "*" + t + "*"; + x = "*".concat(s, "*"); // Error + x = "*".concat(n, "*"); + x = "*".concat(b, "*"); // Error + x = "*".concat(t, "*"); } var value1 = "abc"; -var templated1 = value1 + " abc"; +var templated1 = "".concat(value1, " abc"); // Type '`${string} abc`' is not assignable to type '`${string} ${string}`'. var value2 = "abc"; -var templated2 = value2 + " abc"; +var templated2 = "".concat(value2, " abc"); chain("a"); // Repro from #46125 function ff1(x, y, z) { diff --git a/tests/baselines/reference/templateLiteralsInTypes.js b/tests/baselines/reference/templateLiteralsInTypes.js index d1ff18694fd73..462b08811ca2c 100644 --- a/tests/baselines/reference/templateLiteralsInTypes.js +++ b/tests/baselines/reference/templateLiteralsInTypes.js @@ -6,7 +6,7 @@ f("x").foo; //// [templateLiteralsInTypes.js] "use strict"; -var f = function (hdr, val) { return hdr + ":\t" + val + "\r\n"; }; +var f = function (hdr, val) { return "".concat(hdr, ":\t").concat(val, "\r\n"); }; f("x").foo; diff --git a/tests/baselines/reference/templateLiteralsSourceMap.js b/tests/baselines/reference/templateLiteralsSourceMap.js new file mode 100644 index 0000000000000..3af8719c51055 --- /dev/null +++ b/tests/baselines/reference/templateLiteralsSourceMap.js @@ -0,0 +1,7 @@ +//// [templateLiteralsSourceMap.ts] +const s = `a${0}b${1}c${2}`; + + +//// [templateLiteralsSourceMap.js] +var s = "a".concat(0, "b").concat(1, "c").concat(2); +//# sourceMappingURL=templateLiteralsSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralsSourceMap.js.map b/tests/baselines/reference/templateLiteralsSourceMap.js.map new file mode 100644 index 0000000000000..aad02400df680 --- /dev/null +++ b/tests/baselines/reference/templateLiteralsSourceMap.js.map @@ -0,0 +1,3 @@ +//// [templateLiteralsSourceMap.js.map] +{"version":3,"file":"templateLiteralsSourceMap.js","sourceRoot":"","sources":["templateLiteralsSourceMap.ts"],"names":[],"mappings":"AAAA,IAAM,CAAC,GAAG,WAAI,CAAC,cAAI,CAAC,cAAI,CAAC,CAAE,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,dmFyIHMgPSAiYSIuY29uY2F0KDAsICJiIikuY29uY2F0KDEsICJjIikuY29uY2F0KDIpOw0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGVtcGxhdGVMaXRlcmFsc1NvdXJjZU1hcC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGVMaXRlcmFsc1NvdXJjZU1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlbXBsYXRlTGl0ZXJhbHNTb3VyY2VNYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBTSxDQUFDLEdBQUcsV0FBSSxDQUFDLGNBQUksQ0FBQyxjQUFJLENBQUMsQ0FBRSxDQUFDIn0=,Y29uc3QgcyA9IGBhJHswfWIkezF9YyR7Mn1gOwo= diff --git a/tests/baselines/reference/templateLiteralsSourceMap.sourcemap.txt b/tests/baselines/reference/templateLiteralsSourceMap.sourcemap.txt new file mode 100644 index 0000000000000..fd888d37340ad --- /dev/null +++ b/tests/baselines/reference/templateLiteralsSourceMap.sourcemap.txt @@ -0,0 +1,49 @@ +=================================================================== +JsFile: templateLiteralsSourceMap.js +mapUrl: templateLiteralsSourceMap.js.map +sourceRoot: +sources: templateLiteralsSourceMap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/templateLiteralsSourceMap.js +sourceFile:templateLiteralsSourceMap.ts +------------------------------------------------------------------- +>>>var s = "a".concat(0, "b").concat(1, "c").concat(2); +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^ +8 > ^ +9 > ^^^^^^^^^^^^^^ +10> ^ +11> ^ +12> ^ +1 > +2 >const +3 > s +4 > = +5 > `a${ +6 > 0 +7 > }b${ +8 > 1 +9 > }c${ +10> 2 +11> }` +12> ; +1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(1, 7) + SourceIndex(0) +3 >Emitted(1, 6) Source(1, 8) + SourceIndex(0) +4 >Emitted(1, 9) Source(1, 11) + SourceIndex(0) +5 >Emitted(1, 20) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 21) Source(1, 16) + SourceIndex(0) +7 >Emitted(1, 35) Source(1, 20) + SourceIndex(0) +8 >Emitted(1, 36) Source(1, 21) + SourceIndex(0) +9 >Emitted(1, 50) Source(1, 25) + SourceIndex(0) +10>Emitted(1, 51) Source(1, 26) + SourceIndex(0) +11>Emitted(1, 52) Source(1, 28) + SourceIndex(0) +12>Emitted(1, 53) Source(1, 29) + SourceIndex(0) +--- +>>>//# sourceMappingURL=templateLiteralsSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/templateLiteralsSourceMap.symbols b/tests/baselines/reference/templateLiteralsSourceMap.symbols new file mode 100644 index 0000000000000..0c0205fed3a5d --- /dev/null +++ b/tests/baselines/reference/templateLiteralsSourceMap.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/templateLiteralsSourceMap.ts === +const s = `a${0}b${1}c${2}`; +>s : Symbol(s, Decl(templateLiteralsSourceMap.ts, 0, 5)) + diff --git a/tests/baselines/reference/templateLiteralsSourceMap.types b/tests/baselines/reference/templateLiteralsSourceMap.types new file mode 100644 index 0000000000000..4233343cbc880 --- /dev/null +++ b/tests/baselines/reference/templateLiteralsSourceMap.types @@ -0,0 +1,8 @@ +=== tests/cases/compiler/templateLiteralsSourceMap.ts === +const s = `a${0}b${1}c${2}`; +>s : string +>`a${0}b${1}c${2}` : string +>0 : 0 +>1 : 1 +>2 : 2 + diff --git a/tests/baselines/reference/templateStringBinaryOperations.js b/tests/baselines/reference/templateStringBinaryOperations.js index 74093775b98ba..035f54fead0d5 100644 --- a/tests/baselines/reference/templateStringBinaryOperations.js +++ b/tests/baselines/reference/templateStringBinaryOperations.js @@ -53,51 +53,51 @@ var l4 = 1 + `2${ 3 & 4 }5` + 6; //// [templateStringBinaryOperations.js] -var a = 1 + ("" + 3); -var b = 1 + ("2" + 3); -var c = 1 + (3 + "4"); -var d = 1 + ("2" + 3 + "4"); -var e = "" + 3 + 5; -var f = "2" + 3 + 5; -var g = 3 + "4" + 5; -var h = "2" + 3 + "4" + 5; -var i = 1 + ("" + 3) + 5; -var j = 1 + ("2" + 3) + 5; -var k = 1 + (3 + "4") + 5; -var l = 1 + ("2" + 3 + "4") + 5; -var a2 = 1 + ("" + (3 - 4)); -var b2 = 1 + ("2" + (3 - 4)); -var c2 = 1 + (3 - 4 + "5"); -var d2 = 1 + ("2" + (3 - 4) + "5"); -var e2 = "" + (3 - 4) + 6; -var f2 = "2" + (3 - 4) + 6; -var g2 = 3 - 4 + "5" + 6; -var h2 = "2" + (3 - 4) + "5" + 6; -var i2 = 1 + ("" + (3 - 4)) + 6; -var j2 = 1 + ("2" + (3 - 4)) + 6; -var k2 = 1 + (3 - 4 + "5") + 6; -var l2 = 1 + ("2" + (3 - 4) + "5") + 6; -var a3 = 1 + ("" + 3 * 4); -var b3 = 1 + ("2" + 3 * 4); -var c3 = 1 + (3 * 4 + "5"); -var d3 = 1 + ("2" + 3 * 4 + "5"); -var e3 = "" + 3 * 4 + 6; -var f3 = "2" + 3 * 4 + 6; -var g3 = 3 * 4 + "5" + 6; -var h3 = "2" + 3 * 4 + "5" + 6; -var i3 = 1 + ("" + 3 * 4) + 6; -var j3 = 1 + ("2" + 3 * 4) + 6; -var k3 = 1 + (3 * 4 + "5") + 6; -var l3 = 1 + ("2" + 3 * 4 + "5") + 6; -var a4 = 1 + ("" + (3 & 4)); -var b4 = 1 + ("2" + (3 & 4)); -var c4 = 1 + ((3 & 4) + "5"); -var d4 = 1 + ("2" + (3 & 4) + "5"); -var e4 = "" + (3 & 4) + 6; -var f4 = "2" + (3 & 4) + 6; -var g4 = (3 & 4) + "5" + 6; -var h4 = "2" + (3 & 4) + "5" + 6; -var i4 = 1 + ("" + (3 & 4)) + 6; -var j4 = 1 + ("2" + (3 & 4)) + 6; -var k4 = 1 + ((3 & 4) + "5") + 6; -var l4 = 1 + ("2" + (3 & 4) + "5") + 6; +var a = 1 + "".concat(3); +var b = 1 + "2".concat(3); +var c = 1 + "".concat(3, "4"); +var d = 1 + "2".concat(3, "4"); +var e = "".concat(3) + 5; +var f = "2".concat(3) + 5; +var g = "".concat(3, "4") + 5; +var h = "2".concat(3, "4") + 5; +var i = 1 + "".concat(3) + 5; +var j = 1 + "2".concat(3) + 5; +var k = 1 + "".concat(3, "4") + 5; +var l = 1 + "2".concat(3, "4") + 5; +var a2 = 1 + "".concat(3 - 4); +var b2 = 1 + "2".concat(3 - 4); +var c2 = 1 + "".concat(3 - 4, "5"); +var d2 = 1 + "2".concat(3 - 4, "5"); +var e2 = "".concat(3 - 4) + 6; +var f2 = "2".concat(3 - 4) + 6; +var g2 = "".concat(3 - 4, "5") + 6; +var h2 = "2".concat(3 - 4, "5") + 6; +var i2 = 1 + "".concat(3 - 4) + 6; +var j2 = 1 + "2".concat(3 - 4) + 6; +var k2 = 1 + "".concat(3 - 4, "5") + 6; +var l2 = 1 + "2".concat(3 - 4, "5") + 6; +var a3 = 1 + "".concat(3 * 4); +var b3 = 1 + "2".concat(3 * 4); +var c3 = 1 + "".concat(3 * 4, "5"); +var d3 = 1 + "2".concat(3 * 4, "5"); +var e3 = "".concat(3 * 4) + 6; +var f3 = "2".concat(3 * 4) + 6; +var g3 = "".concat(3 * 4, "5") + 6; +var h3 = "2".concat(3 * 4, "5") + 6; +var i3 = 1 + "".concat(3 * 4) + 6; +var j3 = 1 + "2".concat(3 * 4) + 6; +var k3 = 1 + "".concat(3 * 4, "5") + 6; +var l3 = 1 + "2".concat(3 * 4, "5") + 6; +var a4 = 1 + "".concat(3 & 4); +var b4 = 1 + "2".concat(3 & 4); +var c4 = 1 + "".concat(3 & 4, "5"); +var d4 = 1 + "2".concat(3 & 4, "5"); +var e4 = "".concat(3 & 4) + 6; +var f4 = "2".concat(3 & 4) + 6; +var g4 = "".concat(3 & 4, "5") + 6; +var h4 = "2".concat(3 & 4, "5") + 6; +var i4 = 1 + "".concat(3 & 4) + 6; +var j4 = 1 + "2".concat(3 & 4) + 6; +var k4 = 1 + "".concat(3 & 4, "5") + 6; +var l4 = 1 + "2".concat(3 & 4, "5") + 6; diff --git a/tests/baselines/reference/templateStringBinaryOperationsInvalid.js b/tests/baselines/reference/templateStringBinaryOperationsInvalid.js index e6c288f1b54b2..4fbc6c667d7d8 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsInvalid.js +++ b/tests/baselines/reference/templateStringBinaryOperationsInvalid.js @@ -109,99 +109,99 @@ var hc = `2${ 3 & 4 }5` & 6; //// [templateStringBinaryOperationsInvalid.js] -var a = 1 - ("" + 3); -var b = 1 - ("2" + 3); -var c = 1 - (3 + "4"); -var d = 1 - ("2" + 3 + "4"); -var e = "" + 3 - 5; -var f = "2" + 3 - 5; -var g = 3 + "4" - 5; -var h = "2" + 3 + "4" - 5; -var a2 = 1 * ("" + 3); -var b2 = 1 * ("2" + 3); -var c2 = 1 * (3 + "4"); -var d2 = 1 * ("2" + 3 + "4"); -var e2 = ("" + 3) * 5; -var f2 = ("2" + 3) * 5; -var g2 = (3 + "4") * 5; -var h2 = ("2" + 3 + "4") * 5; -var a3 = 1 & "" + 3; -var b3 = 1 & "2" + 3; -var c3 = 1 & 3 + "4"; -var d3 = 1 & "2" + 3 + "4"; -var e3 = "" + 3 & 5; -var f3 = "2" + 3 & 5; -var g3 = 3 + "4" & 5; -var h3 = "2" + 3 + "4" & 5; -var a4 = 1 - ("" + (3 - 4)); -var b4 = 1 - ("2" + (3 - 4)); -var c4 = 1 - (3 - 4 + "5"); -var d4 = 1 - ("2" + (3 - 4) + "5"); -var e4 = "" + (3 - 4) - 6; -var f4 = "2" + (3 - 4) - 6; -var g4 = 3 - 4 + "5" - 6; -var h4 = "2" + (3 - 4) + "5" - 6; -var a5 = 1 - ("" + 3 * 4); -var b5 = 1 - ("2" + 3 * 4); -var c5 = 1 - (3 * 4 + "5"); -var d5 = 1 - ("2" + 3 * 4 + "5"); -var e5 = "" + 3 * 4 - 6; -var f5 = "2" + 3 * 4 - 6; -var g5 = 3 * 4 + "5" - 6; -var h5 = "2" + 3 * 4 + "5" - 6; -var a6 = 1 - ("" + (3 & 4)); -var b6 = 1 - ("2" + (3 & 4)); -var c6 = 1 - ((3 & 4) + "5"); -var d6 = 1 - ("2" + (3 & 4) + "5"); -var e6 = "" + (3 & 4) - 6; -var f6 = "2" + (3 & 4) - 6; -var g6 = (3 & 4) + "5" - 6; -var h6 = "2" + (3 & 4) + "5" - 6; -var a7 = 1 * ("" + (3 - 4)); -var b7 = 1 * ("2" + (3 - 4)); -var c7 = 1 * (3 - 4 + "5"); -var d7 = 1 * ("2" + (3 - 4) + "5"); -var e7 = ("" + (3 - 4)) * 6; -var f7 = ("2" + (3 - 4)) * 6; -var g7 = (3 - 4 + "5") * 6; -var h7 = ("2" + (3 - 4) + "5") * 6; -var a8 = 1 * ("" + 3 * 4); -var b8 = 1 * ("2" + 3 * 4); -var c8 = 1 * (3 * 4 + "5"); -var d8 = 1 * ("2" + 3 * 4 + "5"); -var e8 = ("" + 3 * 4) * 6; -var f8 = ("2" + 3 * 4) * 6; -var g8 = (3 * 4 + "5") * 6; -var h8 = ("2" + 3 * 4 + "5") * 6; -var a9 = 1 * ("" + (3 & 4)); -var b9 = 1 * ("2" + (3 & 4)); -var c9 = 1 * ((3 & 4) + "5"); -var d9 = 1 * ("2" + (3 & 4) + "5"); -var e9 = ("" + (3 & 4)) * 6; -var f9 = ("2" + (3 & 4)) * 6; -var g9 = ((3 & 4) + "5") * 6; -var h9 = ("2" + (3 & 4) + "5") * 6; -var aa = 1 & "" + (3 - 4); -var ba = 1 & "2" + (3 - 4); -var ca = 1 & 3 - 4 + "5"; -var da = 1 & "2" + (3 - 4) + "5"; -var ea = "" + (3 - 4) & 6; -var fa = "2" + (3 - 4) & 6; -var ga = 3 - 4 + "5" & 6; -var ha = "2" + (3 - 4) + "5" & 6; -var ab = 1 & "" + 3 * 4; -var bb = 1 & "2" + 3 * 4; -var cb = 1 & 3 * 4 + "5"; -var db = 1 & "2" + 3 * 4 + "5"; -var eb = "" + 3 * 4 & 6; -var fb = "2" + 3 * 4 & 6; -var gb = 3 * 4 + "5" & 6; -var hb = "2" + 3 * 4 + "5" & 6; -var ac = 1 & "" + (3 & 4); -var bc = 1 & "2" + (3 & 4); -var cc = 1 & (3 & 4) + "5"; -var dc = 1 & "2" + (3 & 4) + "5"; -var ec = "" + (3 & 4) & 6; -var fc = "2" + (3 & 4) & 6; -var gc = (3 & 4) + "5" & 6; -var hc = "2" + (3 & 4) + "5" & 6; +var a = 1 - "".concat(3); +var b = 1 - "2".concat(3); +var c = 1 - "".concat(3, "4"); +var d = 1 - "2".concat(3, "4"); +var e = "".concat(3) - 5; +var f = "2".concat(3) - 5; +var g = "".concat(3, "4") - 5; +var h = "2".concat(3, "4") - 5; +var a2 = 1 * "".concat(3); +var b2 = 1 * "2".concat(3); +var c2 = 1 * "".concat(3, "4"); +var d2 = 1 * "2".concat(3, "4"); +var e2 = "".concat(3) * 5; +var f2 = "2".concat(3) * 5; +var g2 = "".concat(3, "4") * 5; +var h2 = "2".concat(3, "4") * 5; +var a3 = 1 & "".concat(3); +var b3 = 1 & "2".concat(3); +var c3 = 1 & "".concat(3, "4"); +var d3 = 1 & "2".concat(3, "4"); +var e3 = "".concat(3) & 5; +var f3 = "2".concat(3) & 5; +var g3 = "".concat(3, "4") & 5; +var h3 = "2".concat(3, "4") & 5; +var a4 = 1 - "".concat(3 - 4); +var b4 = 1 - "2".concat(3 - 4); +var c4 = 1 - "".concat(3 - 4, "5"); +var d4 = 1 - "2".concat(3 - 4, "5"); +var e4 = "".concat(3 - 4) - 6; +var f4 = "2".concat(3 - 4) - 6; +var g4 = "".concat(3 - 4, "5") - 6; +var h4 = "2".concat(3 - 4, "5") - 6; +var a5 = 1 - "".concat(3 * 4); +var b5 = 1 - "2".concat(3 * 4); +var c5 = 1 - "".concat(3 * 4, "5"); +var d5 = 1 - "2".concat(3 * 4, "5"); +var e5 = "".concat(3 * 4) - 6; +var f5 = "2".concat(3 * 4) - 6; +var g5 = "".concat(3 * 4, "5") - 6; +var h5 = "2".concat(3 * 4, "5") - 6; +var a6 = 1 - "".concat(3 & 4); +var b6 = 1 - "2".concat(3 & 4); +var c6 = 1 - "".concat(3 & 4, "5"); +var d6 = 1 - "2".concat(3 & 4, "5"); +var e6 = "".concat(3 & 4) - 6; +var f6 = "2".concat(3 & 4) - 6; +var g6 = "".concat(3 & 4, "5") - 6; +var h6 = "2".concat(3 & 4, "5") - 6; +var a7 = 1 * "".concat(3 - 4); +var b7 = 1 * "2".concat(3 - 4); +var c7 = 1 * "".concat(3 - 4, "5"); +var d7 = 1 * "2".concat(3 - 4, "5"); +var e7 = "".concat(3 - 4) * 6; +var f7 = "2".concat(3 - 4) * 6; +var g7 = "".concat(3 - 4, "5") * 6; +var h7 = "2".concat(3 - 4, "5") * 6; +var a8 = 1 * "".concat(3 * 4); +var b8 = 1 * "2".concat(3 * 4); +var c8 = 1 * "".concat(3 * 4, "5"); +var d8 = 1 * "2".concat(3 * 4, "5"); +var e8 = "".concat(3 * 4) * 6; +var f8 = "2".concat(3 * 4) * 6; +var g8 = "".concat(3 * 4, "5") * 6; +var h8 = "2".concat(3 * 4, "5") * 6; +var a9 = 1 * "".concat(3 & 4); +var b9 = 1 * "2".concat(3 & 4); +var c9 = 1 * "".concat(3 & 4, "5"); +var d9 = 1 * "2".concat(3 & 4, "5"); +var e9 = "".concat(3 & 4) * 6; +var f9 = "2".concat(3 & 4) * 6; +var g9 = "".concat(3 & 4, "5") * 6; +var h9 = "2".concat(3 & 4, "5") * 6; +var aa = 1 & "".concat(3 - 4); +var ba = 1 & "2".concat(3 - 4); +var ca = 1 & "".concat(3 - 4, "5"); +var da = 1 & "2".concat(3 - 4, "5"); +var ea = "".concat(3 - 4) & 6; +var fa = "2".concat(3 - 4) & 6; +var ga = "".concat(3 - 4, "5") & 6; +var ha = "2".concat(3 - 4, "5") & 6; +var ab = 1 & "".concat(3 * 4); +var bb = 1 & "2".concat(3 * 4); +var cb = 1 & "".concat(3 * 4, "5"); +var db = 1 & "2".concat(3 * 4, "5"); +var eb = "".concat(3 * 4) & 6; +var fb = "2".concat(3 * 4) & 6; +var gb = "".concat(3 * 4, "5") & 6; +var hb = "2".concat(3 * 4, "5") & 6; +var ac = 1 & "".concat(3 & 4); +var bc = 1 & "2".concat(3 & 4); +var cc = 1 & "".concat(3 & 4, "5"); +var dc = 1 & "2".concat(3 & 4, "5"); +var ec = "".concat(3 & 4) & 6; +var fc = "2".concat(3 & 4) & 6; +var gc = "".concat(3 & 4, "5") & 6; +var hc = "2".concat(3 & 4, "5") & 6; diff --git a/tests/baselines/reference/templateStringInArray.js b/tests/baselines/reference/templateStringInArray.js index 7b387ae8e7475..63982c0b06436 100644 --- a/tests/baselines/reference/templateStringInArray.js +++ b/tests/baselines/reference/templateStringInArray.js @@ -2,4 +2,4 @@ var x = [1, 2, `abc${ 123 }def`]; //// [templateStringInArray.js] -var x = [1, 2, "abc" + 123 + "def"]; +var x = [1, 2, "abc".concat(123, "def")]; diff --git a/tests/baselines/reference/templateStringInArrowFunction.js b/tests/baselines/reference/templateStringInArrowFunction.js index 3e72edf031f3e..366f0ba15f732 100644 --- a/tests/baselines/reference/templateStringInArrowFunction.js +++ b/tests/baselines/reference/templateStringInArrowFunction.js @@ -2,4 +2,4 @@ var x = x => `abc${ x }def`; //// [templateStringInArrowFunction.js] -var x = function (x) { return "abc" + x + "def"; }; +var x = function (x) { return "abc".concat(x, "def"); }; diff --git a/tests/baselines/reference/templateStringInCallExpression.js b/tests/baselines/reference/templateStringInCallExpression.js index aa0671a186207..affdad6e9e286 100644 --- a/tests/baselines/reference/templateStringInCallExpression.js +++ b/tests/baselines/reference/templateStringInCallExpression.js @@ -2,4 +2,4 @@ `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); //// [templateStringInCallExpression.js] -("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3"); +"abc".concat(0, "abc")("hello ".concat(0, " world"), " ", "1".concat(2, "3")); diff --git a/tests/baselines/reference/templateStringInConditional.js b/tests/baselines/reference/templateStringInConditional.js index 8ffcf24e5f490..f6c3d08307315 100644 --- a/tests/baselines/reference/templateStringInConditional.js +++ b/tests/baselines/reference/templateStringInConditional.js @@ -2,4 +2,4 @@ var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; //// [templateStringInConditional.js] -var x = "abc" + " " + "def" ? "abc" + " " + "def" : "abc" + " " + "def"; +var x = "abc".concat(" ", "def") ? "abc".concat(" ", "def") : "abc".concat(" ", "def"); diff --git a/tests/baselines/reference/templateStringInDeleteExpression.js b/tests/baselines/reference/templateStringInDeleteExpression.js index e8da2e2ba32e2..9159f976b825d 100644 --- a/tests/baselines/reference/templateStringInDeleteExpression.js +++ b/tests/baselines/reference/templateStringInDeleteExpression.js @@ -2,4 +2,4 @@ delete `abc${0}abc`; //// [templateStringInDeleteExpression.js] -delete ("abc" + 0 + "abc"); +delete "abc".concat(0, "abc"); diff --git a/tests/baselines/reference/templateStringInDivision.js b/tests/baselines/reference/templateStringInDivision.js index d624d73f6bb66..639a78d24ed6b 100644 --- a/tests/baselines/reference/templateStringInDivision.js +++ b/tests/baselines/reference/templateStringInDivision.js @@ -2,4 +2,4 @@ var x = `abc${ 1 }def` / 1; //// [templateStringInDivision.js] -var x = ("abc" + 1 + "def") / 1; +var x = "abc".concat(1, "def") / 1; diff --git a/tests/baselines/reference/templateStringInEqualityChecks.js b/tests/baselines/reference/templateStringInEqualityChecks.js index f7573f8efd59e..ad7774f381396 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.js +++ b/tests/baselines/reference/templateStringInEqualityChecks.js @@ -5,7 +5,7 @@ var x = `abc${0}abc` === `abc` || "abc0abc" !== `abc${0}abc`; //// [templateStringInEqualityChecks.js] -var x = "abc" + 0 + "abc" === "abc" || - "abc" !== "abc" + 0 + "abc" && - "abc" + 0 + "abc" == "abc0abc" && - "abc0abc" !== "abc" + 0 + "abc"; +var x = "abc".concat(0, "abc") === "abc" || + "abc" !== "abc".concat(0, "abc") && + "abc".concat(0, "abc") == "abc0abc" && + "abc0abc" !== "abc".concat(0, "abc"); diff --git a/tests/baselines/reference/templateStringInFunctionExpression.js b/tests/baselines/reference/templateStringInFunctionExpression.js index 9711b2edc3a36..deb6b23cf5e02 100644 --- a/tests/baselines/reference/templateStringInFunctionExpression.js +++ b/tests/baselines/reference/templateStringInFunctionExpression.js @@ -6,6 +6,6 @@ var x = function y() { //// [templateStringInFunctionExpression.js] var x = function y() { - "abc" + 0 + "def"; - return "abc" + 0 + "def"; + "abc".concat(0, "def"); + return "abc".concat(0, "def"); }; diff --git a/tests/baselines/reference/templateStringInInOperator.js b/tests/baselines/reference/templateStringInInOperator.js index c496e335dd434..ab2082b9e44e2 100644 --- a/tests/baselines/reference/templateStringInInOperator.js +++ b/tests/baselines/reference/templateStringInInOperator.js @@ -2,4 +2,4 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; //// [templateStringInInOperator.js] -var x = "" + "hi" in { hi: 10, hello: 20 }; +var x = "".concat("hi") in { hi: 10, hello: 20 }; diff --git a/tests/baselines/reference/templateStringInIndexExpression.js b/tests/baselines/reference/templateStringInIndexExpression.js index 680cfb49f47e4..56910937c619b 100644 --- a/tests/baselines/reference/templateStringInIndexExpression.js +++ b/tests/baselines/reference/templateStringInIndexExpression.js @@ -2,4 +2,4 @@ `abc${0}abc`[`0`]; //// [templateStringInIndexExpression.js] -("abc" + 0 + "abc")["0"]; +"abc".concat(0, "abc")["0"]; diff --git a/tests/baselines/reference/templateStringInInstanceOf.js b/tests/baselines/reference/templateStringInInstanceOf.js index ccf022cc70336..afb7ddfac73f3 100644 --- a/tests/baselines/reference/templateStringInInstanceOf.js +++ b/tests/baselines/reference/templateStringInInstanceOf.js @@ -2,4 +2,4 @@ var x = `abc${ 0 }def` instanceof String; //// [templateStringInInstanceOf.js] -var x = "abc" + 0 + "def" instanceof String; +var x = "abc".concat(0, "def") instanceof String; diff --git a/tests/baselines/reference/templateStringInModulo.js b/tests/baselines/reference/templateStringInModulo.js index 65d5ec7eaab3a..59de4441290fc 100644 --- a/tests/baselines/reference/templateStringInModulo.js +++ b/tests/baselines/reference/templateStringInModulo.js @@ -2,4 +2,4 @@ var x = 1 % `abc${ 1 }def`; //// [templateStringInModulo.js] -var x = 1 % ("abc" + 1 + "def"); +var x = 1 % "abc".concat(1, "def"); diff --git a/tests/baselines/reference/templateStringInMultiplication.js b/tests/baselines/reference/templateStringInMultiplication.js index e48db6e1715a8..1117d9db8e3e7 100644 --- a/tests/baselines/reference/templateStringInMultiplication.js +++ b/tests/baselines/reference/templateStringInMultiplication.js @@ -2,4 +2,4 @@ var x = 1 * `abc${ 1 }def`; //// [templateStringInMultiplication.js] -var x = 1 * ("abc" + 1 + "def"); +var x = 1 * "abc".concat(1, "def"); diff --git a/tests/baselines/reference/templateStringInNewExpression.js b/tests/baselines/reference/templateStringInNewExpression.js index 1b1770c619719..bf06bfbcc1370 100644 --- a/tests/baselines/reference/templateStringInNewExpression.js +++ b/tests/baselines/reference/templateStringInNewExpression.js @@ -2,4 +2,4 @@ new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); //// [templateStringInNewExpression.js] -new ("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3"); +new ("abc".concat(0, "abc"))("hello ".concat(0, " world"), " ", "1".concat(2, "3")); diff --git a/tests/baselines/reference/templateStringInNewOperator.js b/tests/baselines/reference/templateStringInNewOperator.js index 8d76d59f7eecb..436d7c0a92b7d 100644 --- a/tests/baselines/reference/templateStringInNewOperator.js +++ b/tests/baselines/reference/templateStringInNewOperator.js @@ -2,4 +2,4 @@ var x = new `abc${ 1 }def`; //// [templateStringInNewOperator.js] -var x = new ("abc" + 1 + "def"); +var x = new ("abc".concat(1, "def")); diff --git a/tests/baselines/reference/templateStringInObjectLiteral.js b/tests/baselines/reference/templateStringInObjectLiteral.js index e007ff7b7e745..7dc462a4fce90 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.js +++ b/tests/baselines/reference/templateStringInObjectLiteral.js @@ -10,6 +10,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook return cooked; }; var x = { - a: "abc" + 123 + "def" + a: "abc".concat(123, "def") }(__makeTemplateObject(["b"], ["b"])); 321; diff --git a/tests/baselines/reference/templateStringInParentheses.js b/tests/baselines/reference/templateStringInParentheses.js index 6c5c678bf4e85..67199b0616f7b 100644 --- a/tests/baselines/reference/templateStringInParentheses.js +++ b/tests/baselines/reference/templateStringInParentheses.js @@ -2,4 +2,4 @@ var x = (`abc${0}abc`); //// [templateStringInParentheses.js] -var x = ("abc" + 0 + "abc"); +var x = ("abc".concat(0, "abc")); diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.js b/tests/baselines/reference/templateStringInPropertyAssignment.js index 99fb24712c017..fd8f55860474d 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignment.js +++ b/tests/baselines/reference/templateStringInPropertyAssignment.js @@ -5,5 +5,5 @@ var x = { //// [templateStringInPropertyAssignment.js] var x = { - a: "abc" + 123 + "def" + 456 + "ghi" + a: "abc".concat(123, "def").concat(456, "ghi") }; diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.js b/tests/baselines/reference/templateStringInSwitchAndCase.js index 67f182f8012d3..2bbdc2be00741 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCase.js +++ b/tests/baselines/reference/templateStringInSwitchAndCase.js @@ -7,9 +7,9 @@ switch (`abc${0}abc`) { } //// [templateStringInSwitchAndCase.js] -switch ("abc" + 0 + "abc") { +switch ("abc".concat(0, "abc")) { case "abc": case "123": - case "abc" + 0 + "abc": - "def" + 1 + "def"; + case "abc".concat(0, "abc"): + "def".concat(1, "def"); } diff --git a/tests/baselines/reference/templateStringInTaggedTemplate.js b/tests/baselines/reference/templateStringInTaggedTemplate.js index 29b85bf71ea5d..df0f1dd8954be 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplate.js +++ b/tests/baselines/reference/templateStringInTaggedTemplate.js @@ -6,4 +6,4 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; -("I AM THE " + "TAG" + " " + " PORTION")(__makeTemplateObject(["I ", " THE TEMPLATE PORTION"], ["I ", " THE TEMPLATE PORTION"]), "AM"); +"I AM THE ".concat("".concat("TAG", " "), " PORTION")(__makeTemplateObject(["I ", " THE TEMPLATE PORTION"], ["I ", " THE TEMPLATE PORTION"]), "AM"); diff --git a/tests/baselines/reference/templateStringInTypeAssertion.js b/tests/baselines/reference/templateStringInTypeAssertion.js index 723e688d94b0d..438aca44293ab 100644 --- a/tests/baselines/reference/templateStringInTypeAssertion.js +++ b/tests/baselines/reference/templateStringInTypeAssertion.js @@ -2,4 +2,4 @@ var x = `abc${ 123 }def`; //// [templateStringInTypeAssertion.js] -var x = "abc" + 123 + "def"; +var x = "abc".concat(123, "def"); diff --git a/tests/baselines/reference/templateStringInTypeOf.js b/tests/baselines/reference/templateStringInTypeOf.js index 2543091df8831..27bdc9090d16b 100644 --- a/tests/baselines/reference/templateStringInTypeOf.js +++ b/tests/baselines/reference/templateStringInTypeOf.js @@ -2,4 +2,4 @@ var x = typeof `abc${ 123 }def`; //// [templateStringInTypeOf.js] -var x = typeof ("abc" + 123 + "def"); +var x = typeof "abc".concat(123, "def"); diff --git a/tests/baselines/reference/templateStringInUnaryPlus.js b/tests/baselines/reference/templateStringInUnaryPlus.js index 83f107b3ac2fd..224c289af40f2 100644 --- a/tests/baselines/reference/templateStringInUnaryPlus.js +++ b/tests/baselines/reference/templateStringInUnaryPlus.js @@ -2,4 +2,4 @@ var x = +`abc${ 123 }def`; //// [templateStringInUnaryPlus.js] -var x = +("abc" + 123 + "def"); +var x = +"abc".concat(123, "def"); diff --git a/tests/baselines/reference/templateStringInWhile.js b/tests/baselines/reference/templateStringInWhile.js index 31f7dba45d1da..ad77fe0aac84a 100644 --- a/tests/baselines/reference/templateStringInWhile.js +++ b/tests/baselines/reference/templateStringInWhile.js @@ -4,6 +4,6 @@ while (`abc${0}abc`) { } //// [templateStringInWhile.js] -while ("abc" + 0 + "abc") { - "def" + 1 + "def"; +while ("abc".concat(0, "abc")) { + "def".concat(1, "def"); } diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.js b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.js index cc7b26dec83c0..0cdbc58c9b358 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.js +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.js @@ -2,4 +2,4 @@ `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` //// [templateStringPlainCharactersThatArePartsOfEscapes02.js] -"0" + " " + "1" + " " + "2" + " " + "3" + " " + "4" + " " + "5" + " " + "6" + " " + "7" + " " + "8" + " " + "9" + " " + "10" + " " + "11" + " " + "12" + " " + "13" + " " + "14" + " " + "15" + " " + "16" + " " + "17" + " " + "18" + " " + "19" + " " + "20" + " " + "2028" + " " + "2029" + " " + "0085" + " " + "t" + " " + "v" + " " + "f" + " " + "b" + " " + "r" + " " + "n"; +"0".concat(" ", "1").concat(" ", "2").concat(" ", "3").concat(" ", "4").concat(" ", "5").concat(" ", "6").concat(" ", "7").concat(" ", "8").concat(" ", "9").concat(" ", "10").concat(" ", "11").concat(" ", "12").concat(" ", "13").concat(" ", "14").concat(" ", "15").concat(" ", "16").concat(" ", "17").concat(" ", "18").concat(" ", "19").concat(" ", "20").concat(" ", "2028").concat(" ", "2029").concat(" ", "0085").concat(" ", "t").concat(" ", "v").concat(" ", "f").concat(" ", "b").concat(" ", "r").concat(" ", "n"); diff --git a/tests/baselines/reference/templateStringWithCommentsInArrowFunction.js b/tests/baselines/reference/templateStringWithCommentsInArrowFunction.js index df8a47410f554..b63772c0a68c2 100644 --- a/tests/baselines/reference/templateStringWithCommentsInArrowFunction.js +++ b/tests/baselines/reference/templateStringWithCommentsInArrowFunction.js @@ -16,12 +16,12 @@ const f2 = () => //// [templateStringWithCommentsInArrowFunction.js] var a = 1; var f1 = function () { - return "" + + return "".concat( // a - a + "a"; + a, "a"); }; var f2 = function () { - return "" + + return "".concat( // a - a; + a); }; diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.js b/tests/baselines/reference/templateStringWithEmbeddedAddition.js index 2cf74941600fd..8f322e1170e56 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAddition.js +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.js @@ -2,4 +2,4 @@ var x = `abc${ 10 + 10 }def`; //// [templateStringWithEmbeddedAddition.js] -var x = "abc" + (10 + 10) + "def"; +var x = "abc".concat(10 + 10, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.js b/tests/baselines/reference/templateStringWithEmbeddedArray.js index 1fb6512db478b..1d1abeebff0f4 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArray.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.js @@ -2,4 +2,4 @@ var x = `abc${ [1,2,3] }def`; //// [templateStringWithEmbeddedArray.js] -var x = "abc" + [1, 2, 3] + "def"; +var x = "abc".concat([1, 2, 3], "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js index eb2579b0cc32b..66fcbd3218568 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.js @@ -2,4 +2,4 @@ var x = `abc${ x => x }def`; //// [templateStringWithEmbeddedArrowFunction.js] -var x = "abc" + function (x) { return x; } + "def"; +var x = "abc".concat(function (x) { return x; }, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.js b/tests/baselines/reference/templateStringWithEmbeddedComments.js index 730997e28fb33..4778efbf9db21 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedComments.js +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.js @@ -13,9 +13,12 @@ middle${ tail`; //// [templateStringWithEmbeddedComments.js] -"head" + 10 + "\nmiddle" + +"head".concat(// single line comment +10, "\nmiddle").concat( /* Multi- * line * comment */ -20 + "\ntail"; +20 +// closing comment +, "\ntail"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.js b/tests/baselines/reference/templateStringWithEmbeddedConditional.js index 5b03f56a019fb..d7f35cc7ffee3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditional.js +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.js @@ -2,4 +2,4 @@ var x = `abc${ true ? false : " " }def`; //// [templateStringWithEmbeddedConditional.js] -var x = "abc" + (true ? false : " ") + "def"; +var x = "abc".concat(true ? false : " ", "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.js b/tests/baselines/reference/templateStringWithEmbeddedDivision.js index f9996ae035d9d..6959e7afe7e2f 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivision.js +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.js @@ -2,4 +2,4 @@ var x = `abc${ 1 / 1 }def`; //// [templateStringWithEmbeddedDivision.js] -var x = "abc" + 1 / 1 + "def"; +var x = "abc".concat(1 / 1, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js index 88a8349d1a413..2c0b4e45746a6 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.js @@ -2,4 +2,4 @@ var x = `abc${ function y() { return y; } }def`; //// [templateStringWithEmbeddedFunctionExpression.js] -var x = "abc" + function y() { return y; } + "def"; +var x = "abc".concat(function y() { return y; }, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.js b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js index 091843ea52e9a..ab30a23c8459b 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperator.js +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.js @@ -2,4 +2,4 @@ var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; //// [templateStringWithEmbeddedInOperator.js] -var x = "abc" + ("hi" in { hi: 10, hello: 20 }) + "def"; +var x = "abc".concat("hi" in { hi: 10, hello: 20 }, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js index 009f6bf988d0d..acb84e4c92b4d 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.js @@ -2,4 +2,4 @@ var x = `abc${ "hello" instanceof String }def`; //// [templateStringWithEmbeddedInstanceOf.js] -var x = "abc" + ("hello" instanceof String) + "def"; +var x = "abc".concat("hello" instanceof String, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.js b/tests/baselines/reference/templateStringWithEmbeddedModulo.js index 6fe9be6431454..afb9a0716c9ec 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModulo.js +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.js @@ -2,4 +2,4 @@ var x = `abc${ 1 % 1 }def`; //// [templateStringWithEmbeddedModulo.js] -var x = "abc" + 1 % 1 + "def"; +var x = "abc".concat(1 % 1, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js index 7ac4b1b534c78..27049b5b76db6 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.js @@ -2,4 +2,4 @@ var x = `abc${ 7 * 6 }def`; //// [templateStringWithEmbeddedMultiplication.js] -var x = "abc" + 7 * 6 + "def"; +var x = "abc".concat(7 * 6, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js index 480fbe2573daf..f6e88cfaf413d 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.js @@ -2,4 +2,4 @@ var x = `abc${ new String("Hi") }def`; //// [templateStringWithEmbeddedNewOperator.js] -var x = "abc" + new String("Hi") + "def"; +var x = "abc".concat(new String("Hi"), "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js index 40ecf486245da..8fd83d89ad9dd 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.js @@ -2,4 +2,4 @@ var x = `abc${ { x: 10, y: 20 } }def`; //// [templateStringWithEmbeddedObjectLiteral.js] -var x = "abc" + { x: 10, y: 20 } + "def"; +var x = "abc".concat({ x: 10, y: 20 }, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js index c0059dbb9508d..ece7755341f08 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.js @@ -2,4 +2,4 @@ var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; //// [templateStringWithEmbeddedTemplateString.js] -var x = "123" + "456 " + " | " + " 654" + "321 123" + "456 " + " | " + " 654" + "321"; +var x = "123".concat("456 ".concat(" | ", " 654"), "321 123").concat("456 ".concat(" | ", " 654"), "321"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js index 89d9ba6940c8c..3e18c60766ae9 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.js @@ -2,4 +2,4 @@ var x = `abc${ (10 + 10) }def`; //// [templateStringWithEmbeddedTypeAssertionOnAddition.js] -var x = "abc" + (10 + 10) + "def"; +var x = "abc".concat((10 + 10), "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js index 10450707b11a3..544b3245414e5 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.js @@ -2,4 +2,4 @@ var x = `abc${ typeof "hi" }def`; //// [templateStringWithEmbeddedTypeOfOperator.js] -var x = "abc" + typeof "hi" + "def"; +var x = "abc".concat(typeof "hi", "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js index a4a9c1a850859..7be80f3aed3e4 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.js @@ -2,4 +2,4 @@ var x = `abc${ +Infinity }def`; //// [templateStringWithEmbeddedUnaryPlus.js] -var x = "abc" + +Infinity + "def"; +var x = "abc".concat(+Infinity, "def"); diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.js b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.js index 53eb1b5af2211..a3a1bdcc504ca 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.js +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.js @@ -38,10 +38,10 @@ function gen() { return __generator(this, function (_b) { switch (_b.label) { case 0: - _a = "abc"; + _a = "abc".concat; return [4 /*yield*/, 10]; case 1: - x = _a + (_b.sent()) + "def"; + x = _a.apply("abc", [_b.sent(), "def"]); return [2 /*return*/]; } }); diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js index e7a35d76f45d1..5703114d2d49d 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.js @@ -28,15 +28,15 @@ var m = `1${ 0 }2${ 0 }3`; //// [templateStringWithEmptyLiteralPortions.js] var a = ""; -var b = "" + 0; -var c = "1" + 0; -var d = 0 + "2"; -var e = "1" + 0 + "2"; -var f = "" + 0 + 0; -var g = "1" + 0 + 0; -var h = 0 + "2" + 0; -var i = "1" + 0 + "2" + 0; -var j = "" + 0 + 0 + "3"; -var k = "1" + 0 + 0 + "3"; -var l = 0 + "2" + 0 + "3"; -var m = "1" + 0 + "2" + 0 + "3"; +var b = "".concat(0); +var c = "1".concat(0); +var d = "".concat(0, "2"); +var e = "1".concat(0, "2"); +var f = "".concat(0).concat(0); +var g = "1".concat(0).concat(0); +var h = "".concat(0, "2").concat(0); +var i = "1".concat(0, "2").concat(0); +var j = "".concat(0).concat(0, "3"); +var k = "1".concat(0).concat(0, "3"); +var l = "".concat(0, "2").concat(0, "3"); +var m = "1".concat(0, "2").concat(0, "3"); diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js index 233ab78a19538..3469a5db07fd2 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.js @@ -2,4 +2,4 @@ ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` //// [templateStringWithOpenCommentInStringPortion.js] -" /**head " + 10 + " // still middle " + 20 + " /* still tail "; +" /**head ".concat(10, " // still middle ").concat(20, " /* still tail "); diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.js b/tests/baselines/reference/templateStringWithPropertyAccess.js index 9866b6bd53be5..5a43a87531170 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccess.js +++ b/tests/baselines/reference/templateStringWithPropertyAccess.js @@ -2,4 +2,4 @@ `abc${0}abc`.indexOf(`abc`); //// [templateStringWithPropertyAccess.js] -("abc" + 0 + "abc").indexOf("abc"); +"abc".concat(0, "abc").indexOf("abc"); diff --git a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js index f01741ce68d6b..461648a46c956 100644 --- a/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js +++ b/tests/baselines/reference/templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js @@ -2,4 +2,4 @@ `${function (x: number) { x = "bad"; } }`; //// [templateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression.js] -"" + function (x) { x = "bad"; }; +"".concat(function (x) { x = "bad"; }); diff --git a/tests/baselines/reference/truthinessCallExpressionCoercion.js b/tests/baselines/reference/truthinessCallExpressionCoercion.js index 3f43e62967186..949b64303fdc1 100644 --- a/tests/baselines/reference/truthinessCallExpressionCoercion.js +++ b/tests/baselines/reference/truthinessCallExpressionCoercion.js @@ -159,7 +159,7 @@ var Foo = /** @class */ (function () { // Test for GH-35557 where ids were not assigned for a symbol. function A(stats) { if (stats.isDirectory) { // err - console.log("[Directory] " + stats.ctime); + console.log("[Directory] ".concat(stats.ctime)); } } function B(a, b) { diff --git a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js index e941596a11403..3bfd6267acf6a 100644 --- a/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js +++ b/tests/baselines/reference/tsbuild/demo/initial-build/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js @@ -196,7 +196,7 @@ function createDog() { return ({ size: "medium", woof: function () { - console.log(this.name + " says \"Woof\"!"); + console.log("".concat(this.name, " says \"Woof\"!")); }, name: (0, utilities_1.makeRandomName)() }); diff --git a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js index 15a8f8af612b5..62e75a2149514 100644 --- a/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js +++ b/tests/baselines/reference/tsbuild/watchMode/demo/updates-with-circular-reference.js @@ -434,7 +434,7 @@ function createDog() { return ({ size: "medium", woof: function () { - console.log(this.name + " says \"Woof\"!"); + console.log("".concat(this.name, " says \"Woof\"!")); }, name: (0, utilities_1.makeRandomName)() }); diff --git a/tests/baselines/reference/typeGuardIntersectionTypes.js b/tests/baselines/reference/typeGuardIntersectionTypes.js index 5a7bc055330d0..fc79e74bea0c0 100644 --- a/tests/baselines/reference/typeGuardIntersectionTypes.js +++ b/tests/baselines/reference/typeGuardIntersectionTypes.js @@ -149,12 +149,12 @@ function identifyBeast(beast) { log("bird - 2 legs, wings"); } else { - log("unknown - " + beast.legs + " legs, wings"); + log("unknown - ".concat(beast.legs, " legs, wings")); } } // All non-winged beasts with legs else { - log("manbearpig - " + beast.legs + " legs, no wings"); + log("manbearpig - ".concat(beast.legs, " legs, no wings")); } } // All beasts without legs diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.js b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.js index 14727c6955101..e822de3560c88 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.js +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.js @@ -3,4 +3,4 @@ var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77 //// [unicodeExtendedEscapesInTemplates20_ES5.js] -var x = "Hello" + " " + "world"; +var x = "Hello".concat(" ", "world"); diff --git a/tests/cases/compiler/templateLiteralsSourceMap.ts b/tests/cases/compiler/templateLiteralsSourceMap.ts new file mode 100644 index 0000000000000..6e56ce184ce99 --- /dev/null +++ b/tests/cases/compiler/templateLiteralsSourceMap.ts @@ -0,0 +1,3 @@ +// @sourcemap: true + +const s = `a${0}b${1}c${2}`;