What steps will reproduce the problem?
1. Attach two click-handler to e.g. document.body
2. the first click-handler removes itself after it has been executed by calling
$(this).removeEvent(argument.callee)
3. the second click-handler is never executed and an error is thrown:
eventColl[i] is undefined.
What is the expected output? What do you see instead?
The second click-handler should be executed.
What version of the product are you using? On what operating system?
2.7, OS X
Please provide any additional information below.
The solution is quite easy: in the function handleEvent on line 1215 in file
DOMAssistantComplete-2.7.js instead of
var eventColl = this.events[eventType];
you need to make a copy the event-handler array and run through the copy
instead. Like so:
var eventColl = this.events[eventType].slice();
Running through a copy makes sure, if an event-handler removes itself, that it
does not mix up
with the index in the for-loop when executing all event-handlers.
Original issue reported on code.google.com by wif...@gmail.com on 16 May 2008 at 1:09
Original issue reported on code.google.com by
wif...@gmail.com
on 16 May 2008 at 1:09