diff --git a/tools/transpiler/spec/lang_spec.js b/tools/transpiler/spec/lang_spec.js index 460d258984..dabfc535e5 100644 --- a/tools/transpiler/spec/lang_spec.js +++ b/tools/transpiler/spec/lang_spec.js @@ -5,5 +5,10 @@ export function main() { it('string interpolation', function() { expect(`${123}-'${456}"`).toEqual('123-\'456"'); }); + + it('multiline string', function () { + expect(`1' +2"`).toEqual('1\'\n2"'); + }); }); } diff --git a/tools/transpiler/src/outputgeneration/DartParseTreeWriter.js b/tools/transpiler/src/outputgeneration/DartParseTreeWriter.js index cad44e4013..908f1473b6 100644 --- a/tools/transpiler/src/outputgeneration/DartParseTreeWriter.js +++ b/tools/transpiler/src/outputgeneration/DartParseTreeWriter.js @@ -75,12 +75,11 @@ export class DartParseTreeWriter extends JavaScriptParseTreeWriter { visitTemplateLiteralExpression(tree) { if (tree.operand) { - this.visitAny(tree.operand); - this.writeSpace_(); + throw new Error('tagged template strings are not supported'); } - this.writeRaw_('"'); + this.writeRaw_("'''"); this.visitList(tree.elements); - this.writeRaw_('"'); + this.writeRaw_("'''"); } visitTemplateLiteralPortion(tree) {