diff options
| author | Antony Lesuisse <al@openerp.com> | 2012-11-10 20:00:14 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2012-11-10 20:00:14 +0100 |
| commit | 3fe19453475e33f17f79fa47148e109295dae98c (patch) | |
| tree | 6822fa4310253e6ed3f3b5ad9c38f251d55cbe55 /addons/web/static/src/js/corelib.js | |
| parent | fac7bea3a21017eeca615083c70efded0aee9c75 (diff) | |
use ES5 bind() for better stack traces
bzr revid: al@openerp.com-20121110190014-ead1981ez6up6ri1
Diffstat (limited to 'addons/web/static/src/js/corelib.js')
| -rw-r--r-- | addons/web/static/src/js/corelib.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index d2e94d37939..f2fb1bb2141 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -429,17 +429,11 @@ instance.web.PropertiesMixin = _.extend({}, instance.web.EventDispatcherMixin, { instance.web.CallbackEnabledMixin = _.extend({}, instance.web.PropertiesMixin, { init: function() { instance.web.PropertiesMixin.init.call(this); - var self = this; // Transform on_/do_* methods into callbacks - var callback_maker = function(fn) { - return function() { - return fn.apply(self, arguments); - } - }; for (var name in this) { if(typeof(this[name]) == "function") { if((/^on_|^do_/).test(name)) { - this[name] = callback_maker(this[name]); + this[name] = this[name].bind(this); } } } |
