Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Prevent infinite recursion on unbindAndTeardown when Observe's _bindings is undefined and Observe is self-referential #461
Previously in util/bind/bind.js
If _bindings was undefined, this sets it to NaN and then does the teardown. If in the teardown this object is touched again, having NaN for bindings will decrement to NaN again, still be falsy, and run the teardown again (eventually leading to a stack fault).
The code in this pull request sets _bindings to 0 if it is undefined. Any subsequent visit to unbindAndTeardown will then decrement it to -1 or less, which is okay because we've already started the teardown process.
On Fri, Aug 16, 2013 at 3:03 PM, Brad (Bradley) Momberger <
added a commit
this pull request
Sep 19, 2013
I bet calling unbind without calling bind might do it.
Sent from my iPhone
On Sep 19, 2013, at 4:24 PM, David Luecke firstname.lastname@example.org wrote: