From c94fc46d8c66a86785955ee57959e7d285c9fa8a Mon Sep 17 00:00:00 2001 From: Peter Rust Date: Tue, 11 Jun 2019 13:10:33 -0700 Subject: [PATCH] Include stack in browser uncaught error reporting --- browser-entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser-entry.js b/browser-entry.js index fd89117755..148af07012 100644 --- a/browser-entry.js +++ b/browser-entry.js @@ -58,8 +58,8 @@ process.removeListener = function(e, fn) { process.on = function(e, fn) { if (e === 'uncaughtException') { - global.onerror = function(err, url, line) { - fn(new Error(err + ' (' + url + ':' + line + ')')); + global.onerror = function(msg, url, line, col, err) { + fn(err || new Error(msg + ' (' + url + ':' + line + ')')); return !mocha.allowUncaught; }; uncaughtExceptionHandlers.push(fn);