From 3fe19453475e33f17f79fa47148e109295dae98c Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Sat, 10 Nov 2012 20:00:14 +0100 Subject: [PATCH] use ES5 bind() for better stack traces bzr revid: al@openerp.com-20121110190014-ead1981ez6up6ri1 --- addons/web/static/src/js/corelib.js | 8 +------- 1 file changed, 1 insertion(+), 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); } } }