mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] code generator: prevent AST change
This commit removes an AST change during the code generation of slots. Before, the `compileTSlot` function deleted the `t-props` attribute directly on `ast.attrs`. This creates wrong code when compiling a second time as the `t-props` attribute does not exist anymore.
This commit is contained in:
committed by
Géry Debongnie
parent
cf8039f643
commit
2b5cea944b
@@ -1350,17 +1350,16 @@ export class CodeGenerator {
|
||||
isMultiple = isMultiple || this.slotNames.has(ast.name);
|
||||
this.slotNames.add(ast.name);
|
||||
}
|
||||
const dynProps = ast.attrs ? ast.attrs["t-props"] : null;
|
||||
if (ast.attrs) {
|
||||
delete ast.attrs["t-props"];
|
||||
}
|
||||
const attrs = { ...ast.attrs };
|
||||
const dynProps = attrs["t-props"];
|
||||
delete attrs["t-props"];
|
||||
let key = this.target.loopLevel ? `key${this.target.loopLevel}` : "key";
|
||||
if (isMultiple) {
|
||||
key = this.generateComponentKey(key);
|
||||
}
|
||||
|
||||
const props = ast.attrs
|
||||
? this.formatPropObject(ast.attrs, ast.attrsTranslationCtx, ctx.translationCtx)
|
||||
? this.formatPropObject(attrs, ast.attrsTranslationCtx, ctx.translationCtx)
|
||||
: [];
|
||||
const scope = this.getPropString(props, dynProps);
|
||||
if (ast.defaultContent) {
|
||||
|
||||
Reference in New Issue
Block a user