[REF] qweb: t-foreach: remove integer support for t-value

Handling it complexifies the compiled code, and it is not really
useful (the same result can be achieved with t-foreach="Array(n)")

Part of #128
This commit is contained in:
Aaron Bohy
2019-06-07 14:10:59 +02:00
committed by Géry Debongnie
parent b14d069ee7
commit 49baf0de6e
6 changed files with 75 additions and 127 deletions
+5 -3
View File
@@ -98,10 +98,12 @@ exports[`composition sub widgets with some state rendered in a loop 1`] = `
var vn1 = h('div', p1, c1);
var _2 = context['state'].numbers;
if (!_2) { throw new Error('QWeb error: Invalid loop expression')}
if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())}
var _3 = _2 instanceof Array ? _2 : Object.keys(_2);
var _3 = _4 = _2;
if (!(_2 instanceof Array)) {
_3 = Object.keys(_2);
_4 = Object.values(_2);
}
var _length3 = _3.length;
var _4 = _2 instanceof Array ? _2 : Object.values(_2);
for (let i = 0; i < _length3; i++) {
context.number_first = i === 0;
context.number_last = i === _length3 - 1;