Like was discussed in Slack chat with @ljharb and @hzoo spaces was added with no particular reason.

https://babeljs.slack.com/archives/discussion/p1481744017001806

I'm still not sure if everything here is correct (for example source maps)
This commit is contained in:
chico
2016-12-21 19:14:39 +03:00
parent ce0c620a9f
commit 2d7703afd9
4 changed files with 12 additions and 14 deletions

View File

@@ -9,9 +9,7 @@ export function TemplateElement(node: Object, parent: Object) {
let value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
if (!isFirst) this.space();
this.token(value);
if (!isLast) this.space();
}
export function TemplateLiteral(node: Object) {

View File

@@ -1,15 +1,15 @@
function multilineTemplate() {
return `I'm done reconfoobling
${ 'the energy motron' }
${ '...or whatever' }`;
${'the energy motron'}
${'...or whatever'}`;
}
{
const foo = `spam
and eggs!`;
const bar = `${ 4 + 2 }`;
const bar = `${4 + 2}`;
const hello = `Hello
${ 'world' }`;
${'world'}`;
}

View File

@@ -15,17 +15,17 @@ Is the order a rabbit?
`;
var middles = `
Is the order ${ order }?
Is the order ${order}?
`;
var middles = `
Is the order ${ order }?
Is the order ${order}?
`;
var middles = `
1. ${ cocoa }
2. ${ chino }
3. ${ rize }
4. ${ syaro }
5. ${ chiya }
1. ${cocoa}
2. ${chino}
3. ${rize}
4. ${syaro}
5. ${chiya}
`;

View File

@@ -3,7 +3,7 @@ html`<b></b>`;
`multi
lines`;
`test ${ interpolation } test`;
`test ${interpolation} test`;
`foob