Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#7089 closed bug (invalid)

handleobj is undefined

Reported by: mrbrdo Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description

production version error = u is undefined.

The problem occured to me when calling .load on an img element. The img element was then removed and added again (with same id) and the .load event added again - this time I got the error. So not the first time but the second. Tested in Firefox and some other browsers aswell.

The fix is easy: on line 1737 change

if ( all
namespace.test( handleObj.namespace ) ) {

to

if ( handleObj && (all
namespace.test( handleObj.namespace )) ) {

Error goes away, everything is ok.

Change History (6)

comment:1 Changed 5 years ago by john

  • Component changed from unfiled to event
  • Resolution set to invalid
  • Status changed from new to closed

Do you have a simplified test case for this? I'm not entirely sure what you're referring to.

comment:2 Changed 5 years ago by mrbrdo

  • Resolution invalid deleted
  • Status changed from closed to reopened

I cannot simplify it, but here is the problematic example: http://www.mrbrdo.net/tmp/jquery-bug/index.htm Click on a thumbnail image at the bottom. The first time this will work ok, but the second time (e.g. click another thumbnail after that), the error will be thrown. If that line is changed in jquery which I mentioned above, the error goes away (not sure if it is the proper fix though). Relevant code is in the gallery.js file.

comment:3 Changed 5 years ago by dmethvin

  • Resolution set to invalid
  • Status changed from reopened to closed

This is most likely due to modifying Object.prototype, I saw an instance of that in ./index_files/json.js included by your page.

comment:4 follow-up: Changed 5 years ago by me@…

I just had this same error in 1.5 (after calling .remove()), and the proposed fix works. Yes, I had extended Object.prototype - is this a situation where jQuery is supposed to fail?

comment:5 in reply to: ↑ 4 Changed 5 years ago by jitter

Replying to me@…:

I just had this same error in 1.5 (after calling .remove()), and the proposed fix works. Yes, I had extended Object.prototype - is this a situation where jQuery is supposed to fail?

Modifying Object.prototype is verboten. As it has all kinds of negative side effects. jQuery is not supported on pages where other code messes with Object.prototype.

Last edited 5 years ago by jitter (previous) (diff)

comment:6 in reply to: ↑ description Changed 4 years ago by vladnicula@…

I found the same error on line 2744 in jquery.1.6.2.js when destroying the second time an item with the same Id when using jasmine BDD for JavaScript.

I added a handlerObj !== undefined to escape this error.

Note: See TracTickets for help on using tickets.