Merge pull request #5026 from chicoxyzzy/dont_add_spaces_in_template_literals

Remove unnecessary spaces around template element
This commit is contained in:
Logan Smyth 2016-12-21 21:19:08 -08:00 committed by GitHub
commit f89461906d
5 changed files with 13 additions and 15 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

View File

@ -1,3 +1,3 @@
var a, b;
var _ref = `${ b++ }`;
var _ref = `${b++}`;
a[_ref] = Math.pow(a[_ref], 1)