#1284 new
Victor

Latest prototype.js from github repo - exception in Opera

Reported by Victor | November 16th, 2011 @ 04:21 PM

When using document.on("click", ...) and clicking with mouse on link to another page, Opera 11.52 throws exception on page unload:

Event thread: unload
Uncaught exception: TypeError: Cannot convert 'Event.cache' to object
Error thrown at line 6458, column 6 in <anonymous function>(event) in http://example.com/app/js/prototype-1.7.js:
    var element = Event.cache[uid].element;

Line 6458 is in createResponder():

  function createResponder(uid, eventName, handler) {
    if (Event._isCustomEvent(eventName))
      return createResponderForCustomEvent(uid, eventName, handler);
    if (isSimulatedMouseEnterLeaveEvent(eventName))
      return createMouseEnterLeaveResponder(uid, eventName, handler);

    return function(event) {
      var element = Event.cache[uid].element; // <- line 6458
      Event.extend(event, element);
      handler.call(element, event);
    };
  }

I traced this code in Opera Dragonfly and found that Opera unloads page and continues calling responder with MouseEvent when either Event.cache is set to null or uid is undefined (closure scope is destroyed).

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Tags

Pages