provide a way to test if a reference is weak #17

Closed
godmar opened this Issue Jun 27, 2013 · 1 comment

Comments

Projects
None yet
2 participants

godmar commented Jun 27, 2013

Is there a way to test if an object represents a weak reference?

If not, please consider adding one, such as 'Weak.isWeakRef(Object obj)'.

We found it terribly useful when debugging our code where we passed a strong reference when we thought a weak one was passed. It would also be useful for assertions.

As a work-around, we used Weak.isDead which throws a TypeError if what's passed is not a weak ref.

Owner

TooTallNate commented Nov 10, 2013

@godmar Sorry for the delay in responding. As it turns out, Weak.isWeakRef() has existed all along! I've documented it properly in the README in 518e459. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment