From 5ee9e1d200dbeabb853156e39ef25f0539347f96 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 12 Mar 2019 09:44:28 +0000 Subject: [PATCH] [FIX] web: correctly display crashes in firefox After the update of jQuery, crashes were no longer displayed (in dialogs) on browsers using the unhandled-rejection-polyfill lib (e.g. firefox). This was due to a bad conversion from ES6 to ES5. Issue reported on the jquery update pad. closes odoo/odoo#31767 Signed-off-by: VincentSchippefilt --- .../unhandled-rejection-polyfill.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/lib/unhandled-rejection-polyfill/unhandled-rejection-polyfill.js b/addons/web/static/lib/unhandled-rejection-polyfill/unhandled-rejection-polyfill.js index 5d1786e69ec..9422078ac37 100644 --- a/addons/web/static/lib/unhandled-rejection-polyfill/unhandled-rejection-polyfill.js +++ b/addons/web/static/lib/unhandled-rejection-polyfill/unhandled-rejection-polyfill.js @@ -51,7 +51,7 @@ MyPromise.prototype.__proto__ = OriginalPromise.prototype; MyPromise.prototype.then = function (resolve, reject) { var self = this; - return OriginalPromise.prototype.then.call(this, resolve, reject && (function reason() { + return OriginalPromise.prototype.then.call(this, resolve, reject && (function (reason) { self.handled = true; return reject(reason); })); @@ -59,7 +59,7 @@ MyPromise.prototype.then = function (resolve, reject) { MyPromise.prototype.catch = function (reject) { var self = this; - return OriginalPromise.prototype.catch.call(this, reject && (function reason() { + return OriginalPromise.prototype.catch.call(this, reject && (function (reason) { self.handled = true; return reject(reason); }));