[jQuery] Catching
[jQuery] Catching
.handleEvent() has a quiet error handler. Because of this, coding errors in
a custom handler are hidden also and difficult to debug. Is there a jQuery
mechanism to set a debug mode so quiet handlers can speak freely?
function handleEvent(event) {
var returnValue = true;
event = event || fixEvent(window.event);
var handlers = [];
for ( var i in this.events[event.type] )
handlers[handlers.length] = this.events[event.type][i];
for ( var i = 0; i < handlers.length; i++ ) {
try {
if ( handlers[i].constructor == Function ) {
this.$$handleEvent = handlers[i];
if (this.$$handleEvent(event) === false) {
event.preventDefault();
event.stopPropagation();
returnValue = false;
}
}
} catch(e){ if (this.DEBUG_MODE) { logError(e); throw(e); } //
}
return returnValue;
};
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/