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:
@@ -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) {
|
||||
|
||||
@@ -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'}`;
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
`;
|
||||
|
||||
@@ -3,7 +3,7 @@ html`<b></b>`;
|
||||
`multi
|
||||
lines`;
|
||||
|
||||
`test ${ interpolation } test`;
|
||||
`test ${interpolation} test`;
|
||||
|
||||
`foob
|
||||
|
||||
|
||||
Reference in New Issue
Block a user