mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] parser, code_generator: wrapped children recognition
Several directives (t-key, t-log, t-translation, …) are represented by wrapper ASTs that contain another AST or null. Because these wrappers don't share the same type as their children, various AST type checks were broken. This commit addresses those issues by: - Commuting Translation / TranslationContext and Multi ASTs so that Multi children are spread as expected (see parseChildren). - Parsing the t-key directive before t-esc / t-out (in line with https://github.com/odoo/owl/pull/1685). - Ensuring wrappers around TSet ASTs are recognized as having no representation, so compileMulti properly discards children equivalent to TSet.
This commit is contained in:
committed by
Géry Debongnie
parent
c2728c9daf
commit
521111644c
@@ -63,4 +63,10 @@ describe("t-key", () => {
|
||||
|
||||
expect(renderToString(template2, { key: "1" })).toBe("<div><h1></h1></div>");
|
||||
});
|
||||
|
||||
test("t-key: interaction with t-esc", async () => {
|
||||
const template = `<p t-key="key" t-esc="text"/>`;
|
||||
|
||||
expect(renderToString(template, { key: "1", text: "abc" })).toBe("<p>abc</p>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user