diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-12-12 20:22:59 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-01-21 07:17:31 +0000 |
| commit | 45246a3b96e0b41e4072c2703473185abe28d840 (patch) | |
| tree | 1f410b886fa2d297a6992e3787b7d74dd15a5715 /addons/web/static/src/js/core/utils.js | |
| parent | 1110ea43a417c63df75b489b67e0c43cd51078de (diff) | |
[FIX] web: utils: fix typos in patch and unpatch
The use of 'this' to call other utils adds a restriction on the
way utils are called from the outside:
utils.patch(...); // works fine
const patch = utils.patch;
patch(...); // doesn't work
Diffstat (limited to 'addons/web/static/src/js/core/utils.js')
| -rw-r--r-- | addons/web/static/src/js/core/utils.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index a4d6f845795..bb4a877f7ba 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -525,7 +525,7 @@ var utils = { * @param {Object} patch * @returns {Function} */ - patch: function(C, patchName, patch) { + patch: function (C, patchName, patch) { let metadata = patchMap.get(C.prototype); if (!metadata) { metadata = { @@ -562,7 +562,7 @@ var utils = { }); } - return this.unpatch.bind(null, C, patchName); + return utils.unpatch.bind(null, C, patchName); }, /** * performs a half up rounding with a fixed amount of decimals, correcting for float loss of precision @@ -722,10 +722,10 @@ var utils = { * @param {Class} C * @param {string} patchName */ - unpatch: function(C, patchName) { + unpatch: function (C, patchName) { const proto = C.prototype; let metadata = patchMap.get(proto); - if (!metdata) { + if (!metadata) { return; } patchMap.delete(proto); @@ -738,7 +738,7 @@ var utils = { // apply other patches for (let name of metadata.current) { if (name !== patchName) { - this.patch(C, name, metadata.patches[name]); + utils.patch(C, name, metadata.patches[name]); } } }, |
