prototype: Prevent a Firefox bug from throwing errors on page load/unload. Closes #5393, #9421.

This commit is contained in:
Tobie Langel 2007-10-22 01:04:17 +00:00
parent ba96fa77bf
commit 827c8c6b48
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Make sure Event and Event.extend are defined before wrapping events and calling their handler. Prevents a known Firefox bug from throwing errors on page load/unload (cf.: https://bugzilla.mozilla.org/show_bug.cgi?id=361271). Closes #5393, #9421. [staaky, John Resig, sam, Tobie Langel]
* Minor cosmetic changes to the display of unit tests in terminal. [Tobie Langel]
* Make submitting forms work in Opera < 9.1. Closes #9917, #9463, #8260. [kangax]

View File

@ -152,8 +152,9 @@ Object.extend(Event, (function() {
if (c.pluck("handler").include(handler)) return false;
var wrapper = function(event) {
if (event.eventName && event.eventName != eventName)
return false;
if (!Event || !Event.extend ||
(event.eventName && event.eventName != eventName))
return false;
Event.extend(event);
handler.call(element, event)