Closed paullewis closed 13 years ago
nice catch, I will create a test to ensure it still work in the future and merge the changes. thanks.
ohh, just realized why there is no check., I considered that _listener
would be always available since the user isn't supposed to change it (variables starting with underscore are pseudo-private) and there is no way to create a binding without a listener
do you have any example on how to make it fail?
Not now, no. The code I've got is for a client so I can't just push it up. But the general idea is this:
In this case the loop through in the dispatch expects the second binding to be there, which it is. But if the _listener property has been deleted it's going to bail, which is what happened for me :)
makes sense and I will integrate it on the next few days and add tests that match your description. thanks!
I was finding that if the SignalBinding was still set to active, but that the signal listener was removed it would execute against an undefined object.
I think it's because in the dispatch loop the binding exists but the actual listener may not. Obviously one may disable the binding but I just added the !!this._listener for safety :)