millermedeiros / js-signals

Custom Event/Messaging system for JavaScript inspired by AS3-Signals
http://millermedeiros.github.com/js-signals/
1.97k stars 179 forks source link

any method that access internal properties from the SignalBinding throws errors after calling `SingalBinding.detach()` #25

Closed millermedeiros closed 13 years ago

millermedeiros commented 13 years ago

as of v0.6.2 the second time you call detach on a binding it throws an error since the binding doesn't have the _signal and _listener properties anymore. I think the proper behavior would be to simply return null instead of throwing an error.. (detach() usually returns the listener)

I think it doesn't make any sense for a binding exist without a listener/signal but throwing errors like this ain't fun or necessary.. (specially if calling detach multiple times..)

maybe add a new method like isBound() that checks if Binding still references a Signal..