diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-12-11 10:00:21 +0000 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2019-12-12 13:34:48 +0000 |
| commit | 3aee5a4cb40f924fb978aed5b0cea10f3dede6e2 (patch) | |
| tree | b690bf655aa35460366524bf73304351643446ab /addons/web/static | |
| parent | fc0f22f9b9e6dd1f186944033c9c85e36a5da930 (diff) | |
[FIX] web: utils: patch: restore _super
Before this rev., this._super wasn't correctly reset after being
called. It means that it was sometimes wrongly set, for instance
in the following scenario:
utils.patch(SomeComponent, {
x: function () {
this.y();
this._super(...arguments); // this._super was still y
},
y: function () {
this._super(...arguments);
},
});
closes odoo/odoo#41691
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/core/utils.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index 4fe1740d6eb..6527207dfc9 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -549,8 +549,11 @@ var utils = { metadata.origMethods[methodName] = original; } proto[methodName] = function (...args) { + const previousSuper = this._super; this._super = original; - return method.call(this, ...args); + const res = method.call(this, ...args); + this._super = previousSuper; + return res; }; } }); |
