nan icon indicating copy to clipboard operation
nan copied to clipboard

Add convenience getter for Local from Persistent

Open kkoopa opened this issue 9 years ago • 6 comments

This is found in newer versions of V8. Needs checking that no leaks were introduced.

kkoopa avatar Oct 11 '15 23:10 kkoopa

Pretty big set of changes, I won't have time to review and am probably not the best for this one anyway, maybe @bnoordhuis or @agnat if they have time.

Missing docs though, is it just Get() that we want to add or should more of this be officially documented, (like .persistent?)

rvagg avatar Oct 12 '15 11:10 rvagg

Just Get, the rest is private, so no point in documenting anything else, since it is not accessible. There were many changes, since I redid the newer implementation not to inherit from v8::PeristentBase<> but to compose it.

On October 12, 2015 2:05:26 PM GMT+03:00, Rod Vagg [email protected] wrote:

Pretty big set of changes, I won't have time to review and am probably not the best for this one anyway, maybe @bnoordhuis or @agnat if they have time.

Missing docs though, is it just Get() that we want to add or should more of this be officially documented, (like .persistent?)


Reply to this email directly or view it on GitHub: https://github.com/nodejs/nan/pull/492#issuecomment-147366737

kkoopa avatar Oct 12 '15 11:10 kkoopa

I wonder if we can simply add Get to Nan::Persistent and Nan::Global instead? This would preserve Nan::PersistentBase and its subclasses as subclasses of v8::PersistentBase FWIW.

brody4hire avatar Oct 12 '15 11:10 brody4hire

Yes, that would work, but I wanted to try and redo the implementation to make it more similar to the other one. Now the hierarchy is the same across versions, as would be expected.

On Monday 12 October 2015 04:36:52 Chris Brody wrote:

I wonder if we can simply add Get to Nan::Persistent and Nan::Global instead? This would preserve Nan::PersistentBase and its subclasses as subclasses of v8::PersistentBase FWIW.


Reply to this email directly or view it on GitHub: https://github.com/nodejs/nan/pull/492#issuecomment-147371189

kkoopa avatar Oct 12 '15 11:10 kkoopa

Sounds reasonable to me. There is an assumption that the user would never need access to the v8::PersistentBase object, hope this will remain true.

brody4hire avatar Oct 12 '15 11:10 brody4hire

That assumption is already there for versions less than 0.12, this makes it explicit in newer versions too. v8::PersistentBase cannot even be directly instantiated.

On Monday 12 October 2015 04:50:21 Chris Brody wrote:

Sounds reasonable to me. There is an assumption that the user would never need access to the v8::PersistentBase object, hope this will remain true.


Reply to this email directly or view it on GitHub: https://github.com/nodejs/nan/pull/492#issuecomment-147373343

kkoopa avatar Oct 12 '15 12:10 kkoopa