[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
+1 -13
View File
@@ -657,7 +657,7 @@ describe("foreach", () => {
"test",
`
<div>
<t t-foreach="5" t-as="elem">
<t t-foreach="Array(5)" t-as="elem">
-<t t-if="elem_first"> first</t><t t-if="elem_last"> last</t> (<t t-esc="elem_index"/>)
</t>
</div>`
@@ -667,18 +667,6 @@ describe("foreach", () => {
expect(result).toBe(expected);
});
test("iterate, integer param", () => {
qweb.addTemplate(
"test",
`<div><t t-foreach="3" t-as="item">
[<t t-esc="item_index"/>: <t t-esc="item"/> <t t-esc="item_value"/>]
</t></div>`
);
const result = trim(renderToString(qweb, "test"));
const expected = `<div>[0:00][1:11][2:22]</div>`;
expect(result).toBe(expected);
});
test("iterate, dict param", () => {
qweb.addTemplate(
"test",