diff --git a/src/astring.js b/src/astring.js index b3400c17..bd55f276 100644 --- a/src/astring.js +++ b/src/astring.js @@ -683,7 +683,7 @@ export const baseGenerator = { const { length } = expressions for (let i = 0; i < length; i++) { const expression = expressions[i] - state.write(quasis[i].value.raw) + this.TemplateElement(quasis[i], state) state.write('${') this[expression.type](expression, state) state.write('}') @@ -691,6 +691,9 @@ export const baseGenerator = { state.write(quasis[quasis.length - 1].value.raw) state.write('`') }, + TemplateElement(node, state) { + state.write(node.value.raw) + }, TaggedTemplateExpression(node, state) { this[node.tag.type](node.tag, state) this[node.quasi.type](node.quasi, state)