Merge pull request #5026 from chicoxyzzy/dont_add_spaces_in_template_literals
Remove unnecessary spaces around template element
This commit is contained in:
commit
f89461906d
@ -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
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
var a, b;
|
||||
var _ref = `${ b++ }`;
|
||||
var _ref = `${b++}`;
|
||||
a[_ref] = Math.pow(a[_ref], 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user