rvagg/nan — pull request #80 by kkoopa (2014-03-13 14:33:41+00:00)
Title: New weak API for new NAN version.

Here is my proposal for the new weak API. This works in both 0.10 and newer 0.11. `NanMakeWeak` is now useless, so I removed it. `NanInitPersistent` never saw much appreciation, and since it can't really be used with weak handles any more, I decided to cut it too. Introduced NanMakeWeakPersistent, which makes a `Persistent` and sets it weak.

I wrote a test which actually does something useful and checks expected behavior of weak handles.

As several thing have been changed and removed, I suggest cleaning up the rest of NAN, making a clean break with outdated 0.11 versions. That will save us a lot of work. If we clean up, this is more or less done. If backwards compatibility (regarding NAN) should be maintained where possible, there is some fixing and testing left to do.

@bnoordhuis Can you review the changes already done? I might have done some horrible mistake, leaking memory or missed a cleaner way of achieving something.