[FIX] component: updateProps: validation and default values

Before this rev., default values weren't taken into account when
validating props whenever a component was updated. Moreover, there
was no test attesting that props were validated at update.
This commit is contained in:
Aaron Bohy
2019-10-28 11:14:29 +01:00
parent 4ebe419c56
commit 5d57a7bf13
4 changed files with 55 additions and 5 deletions
+3
View File
@@ -503,6 +503,9 @@ export class Component<T extends Env, Props extends {}> {
if (defaultProps) {
nextProps = this.__applyDefaultProps(nextProps, defaultProps);
}
if (QWeb.dev) {
QWeb.utils.validateProps(this.constructor, nextProps);
}
await Promise.all([
this.willUpdateProps(nextProps),
__owl__.willUpdatePropsCB && __owl__.willUpdatePropsCB(nextProps)