[FIX] qweb/component: better handling for t-debug

- fix issue with t-debug on a t-set (defining a slot)
- put t-debug and t-log at a very low (high) priority to make sure they
  are executed before other directives

closes #201
This commit is contained in:
Géry Debongnie
2019-06-24 15:28:01 +02:00
parent 4a5db0c283
commit 16bbb8bc9f
3 changed files with 34 additions and 6 deletions
+7 -4
View File
@@ -322,10 +322,13 @@ export class QWeb extends EventBus {
);
}
if (isDebug) {
console.log(
`Template: ${this.templates[name].elem.outerHTML}\nCompiled code:\n` +
template.toString()
);
const tpl = this.templates[name];
if (tpl) {
const msg = `Template: ${
tpl.elem.outerHTML
}\nCompiled code:\n${template.toString()}`;
console.log(msg);
}
}
return template;
}