diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-11-20 09:35:17 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-11-20 10:44:24 +0000 |
| commit | de924f41eebf62516a39749e5924e19875ea59e5 (patch) | |
| tree | c0145e38a875eba17639682b84132460665d949f /addons/web/static/src/js/tools | |
| parent | 153c2a9f9481ea340d81d6a8d59f46a3074fe907 (diff) | |
[IMP] web: testUtils: ensure backward compatibility
Rev. 7c3d5dc0 recently added new helpers to use in the tests, and
moved some existing helpers to testUtils sub groups (like .dom or
.mock).
This rev. adds a compatibility layer to ease forwardports.
closes odoo/odoo#28824
Diffstat (limited to 'addons/web/static/src/js/tools')
| -rw-r--r-- | addons/web/static/src/js/tools/tools.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/addons/web/static/src/js/tools/tools.js b/addons/web/static/src/js/tools/tools.js new file mode 100644 index 00000000000..f886d80d3c5 --- /dev/null +++ b/addons/web/static/src/js/tools/tools.js @@ -0,0 +1,22 @@ +odoo.define('web.tools', function (require) { +"use strict"; + +/** + * Wrapper for deprecated functions that display a warning message. + * + * @param {Function} fn the deprecated function + * @param {string} [message=''] optional message to display + * @returns {Function} + */ +function deprecated(fn, message) { + return function () { + console.warn(message || (fn.name + ' is deprecated.')); + fn.apply(this, arguments); + }; +} + +return { + deprecated: deprecated, +}; + +}); |
