Make exception handler static named function.

This commit is contained in:
Chad Weider 2012-05-28 12:15:22 -07:00
parent bd07589e0f
commit 723f75b016

View file

@ -500,11 +500,7 @@ var padutils = {
}
};
var globalExceptionHandler = undefined;
function setupGlobalExceptionHandler() {
if (!globalExceptionHandler) {
globalExceptionHandler = function test (msg, url, linenumber)
{
function globalExceptionHandler(msg, url, linenumber) {
var errorId = randomString(20);
if ($("#editorloadingbox").attr("display") != "none"){
//show javascript errors to the user
@ -522,8 +518,16 @@ function setupGlobalExceptionHandler() {
$.post(url, errObj);
return false;
};
}
var globalExceptionHandlerSetup = false;
function setupGlobalExceptionHandler() {
if (!globalExceptionHandlerSetup) {
globalExceptionHandlerSetup = true;
window.onerror = globalExceptionHandler;
} else {
// no-op
// TODO: Throw an exception here.
}
}