fix parsing of expressions wrapped in parentheses (#534)

pull/536/head
Conduitry 8 years ago
parent 8e87c688ae
commit a5dce59735

@ -34,7 +34,7 @@ export default function readExpression ( parser ) {
parser.index = start;
try {
const node = parseExpressionAt( parser.template, parser.index );
const node = parseExpressionAt( parser.template, parser.index, { preserveParens: true } );
parser.index = node.end;
return node;

@ -0,0 +1,16 @@
export default {
data: {
a: 'foo',
b: true,
c: [ 1, 2, 3 ],
},
html: `
<span>foo</span>
<span class="foo"></span>
<span>true</span>
<span>1</span>
<span>2</span>
<span>3</span>
`
};

@ -0,0 +1,8 @@
<span>{{ (a) }}</span>
<span class='{{ (a) }}'></span>
{{#if (b) }}
<span>true</span>
{{/if}}
{{#each (c) as x}}
<span>{{x}}</span>
{{/each}}
Loading…
Cancel
Save