[FIX] qweb: properly display falsy values

While it is not tested, nor documented, the reference QWeb
implementation display the `false` value as "false". So, we have to
adapt the Owl implementation to match that behaviour.

At the same time, this commit uses 'let' instead of 'var' in various places,
to make the compiled code more consistant.
This commit is contained in:
Géry Debongnie
2019-12-12 22:27:52 +01:00
committed by aab-odoo
parent 0931a4dc5b
commit 29a80d0b28
12 changed files with 924 additions and 857 deletions
+2 -2
View File
@@ -4520,7 +4520,7 @@ describe("component error handling (catchError)", () => {
}
const app = new App();
await app.mount(fixture);
expect(fixture.innerHTML).toBe("<div><div><div>hey</div></div></div>");
expect(fixture.innerHTML).toBe("<div><div><div>heyfalse</div></div></div>");
app.state.flag = true;
await nextTick();
expect(fixture.innerHTML).toBe("<div><div>Error handled</div></div>");
@@ -4555,7 +4555,7 @@ describe("component error handling (catchError)", () => {
}
const app = new App();
await app.mount(fixture);
expect(fixture.innerHTML).toBe("<div><div>hey</div></div>");
expect(fixture.innerHTML).toBe("<div><div>heyfalse</div></div>");
app.state.flag = true;
await nextTick();
expect(fixture.innerHTML).toBe("");