You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I read the code correctly it should fix the half-baked event I pass in as a second argument and then go through all the listeners and call the handler with the fixed event.
In practice fire() prepends the boolean false (line 517) to the arguments which then gets passed to the nativeHandler's handler (line 334) but the handler expects the argument "event" as the first argument, which now is always false and thus always fixes the wrong event object.
When I change the nativeHandler's handler to
handler=function(f,event)
then things work with no apparent side-effects.
What's the reason the false prepended?
The text was updated successfully, but these errors were encountered:
The 'args' are meant to be additional arguments to the event handler rather than the Event object itself. There is scope though to implement proper Event object handling but it's not in there at the moment.
It's possible that we could squeeze something into the upcoming 1.0 release since it would likely be an API breaking change, or at a minimum we could make room for it in 1.0 for implementation in 1.1 perhaps.
If you feel like contributing, the 1.0 code is in the 0.5-wip branch, there's a write-up here about what's in it and the API breakages: http://rod.vagg.org/2012/08/bean_v1/
Basically I'm trying to do this:
If I read the code correctly it should fix the half-baked event I pass in as a second argument and then go through all the listeners and call the handler with the fixed event.
In practice fire() prepends the boolean false (line 517) to the arguments which then gets passed to the nativeHandler's handler (line 334) but the handler expects the argument "event" as the first argument, which now is always false and thus always fixes the wrong event object.
When I change the nativeHandler's handler to
then things work with no apparent side-effects.
What's the reason the false prepended?
The text was updated successfully, but these errors were encountered: