From 435b9434eaaa70af2566bc4f04fbdef04e1485f6 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 1 Nov 2014 23:26:48 +1100 Subject: [PATCH] don't mess with the indentation of TemplateElements --- lib/6to5/generator.js | 4 ++-- lib/6to5/generators/template-literals.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/generator.js b/lib/6to5/generator.js index 333d68453f..8d8f8b7cc9 100644 --- a/lib/6to5/generator.js +++ b/lib/6to5/generator.js @@ -68,8 +68,8 @@ CodeGenerator.prototype.keyword = function (name) { this.push(" "); }; -CodeGenerator.prototype.push = function (str) { - if (this._indent) { +CodeGenerator.prototype.push = function (str, noIndent) { + if (this._indent && !noIndent) { // we have an indent level and we aren't pushing a newline var indent = this.getIndent(); diff --git a/lib/6to5/generators/template-literals.js b/lib/6to5/generators/template-literals.js index 5072cf2e5c..21e8399386 100644 --- a/lib/6to5/generators/template-literals.js +++ b/lib/6to5/generators/template-literals.js @@ -6,7 +6,7 @@ exports.TaggedTemplateExpression = function (node, print) { }; exports.TemplateElement = function (node, print) { - this.push(node.value.raw); + this.push(node.value.raw, true); }; exports.TemplateLiteral = function (node, print) {