Commit 1634de2b544259afd69d044392015c776ff162e7

Authored by yujiosaka
1 parent 121531ca
Exists in master and in 1 other branch production

call old onerror when it's already defined

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
public/javascripts/notifier.js
@@ -1171,13 +1171,16 @@ printStackTrace.implementation.prototype = { @@ -1171,13 +1171,16 @@ printStackTrace.implementation.prototype = {
1171 } 1171 }
1172 }; 1172 };
1173 1173
  1174 + var oldOnerror = window.onerror;
1174 window.onerror = function (message, file, line, code, error) { 1175 window.onerror = function (message, file, line, code, error) {
1175 setTimeout(function () { 1176 setTimeout(function () {
1176 var e = error || {stack: '()@' + file + ':' + line} 1177 var e = error || {stack: '()@' + file + ':' + line}
1177 e.message = message 1178 e.message = message
1178 new Notifier().notify(e); 1179 new Notifier().notify(e);
1179 }, 0); 1180 }, 0);
1180 - 1181 + if (oldOnerror) {
  1182 + return oldOnerror(message, file, line, code, error);
  1183 + }
1181 return true; 1184 return true;
1182 }; 1185 };
1183 })(); 1186 })();