[FIX] qweb: enclose interpolated expr in parentheses

Since rev 53e53e9b,
 <div class="o_app" t-attf-class="{{ true ? 'o_extra' : '' }}"/>
produced
 <div class="o_extra"/>
whereas it should have produced
 <div class="o_app o_extra"/>

This is because there were missing parentheses around the string
returned by `interpolate`, which produced instructions like

 var _1 = 'o_app ' + true ? 'o_extra' : '';

Fixes #132
This commit is contained in:
Aaron Bohy
2019-05-29 13:21:03 +02:00
committed by Géry Debongnie
parent a08deb895d
commit 4d72a4f240
4 changed files with 26 additions and 8 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ exports[`composition t-widget with dynamic value 1`] = `
w4 = false
}
if (!w4) {
let widgetKey4 = context['state'].widget;
let widgetKey4 = (context['state'].widget);
let W4 = context.widgets && context.widgets[widgetKey4] || QWeb.widgets[widgetKey4];
if (!W4) {throw new Error('Cannot find the definition of widget \\"' + widgetKey4 + '\\"')}
w4 = new W4(owner, props4);