unbind is too greedy when unbinding proxy functions
|Reported by:||sahab.yazdani+jquery@…||Owned by:||rwaldron|
Steps to reproduce:
- Create two proxies of the same function but using different contexts.
- Bind these two proxies unto the same event handler using $().bind
- Unbind one of the proxies using the proxied function handle
- Trigger the event
Note that no event gets triggered
The version of the handler that was not unbound should get triggered.
The JSFiddle will clarify this: http://jsfiddle.net/RD7ZF/7/
As far as I can tell, jQuery has worked like this from the dawn of time, but to me the behviour is rather unexpected. Because the contexts for the proxy functions are different, by extension the two proxy methods are different whereas unbind treats them as being the same.
Change History (4)
comment:1 Changed 6 years ago by rwaldron
- Component changed from unfiled to event
- Owner set to rwaldron
- Status changed from new to assigned
comment:2 Changed 6 years ago by ajpiano
- Resolution set to wontfix
- Status changed from assigned to closed