2011/10/6 Stephan Beal <[email protected]>

> On Thu, Oct 6, 2011 at 4:30 PM, ondras <[email protected]> wrote:
>
>> another question: suppose my JS object "A" (implemented in C++) needs a
>> (hidden) reference to another JS object "B". I store the reference using
>>
>> A->SetInternalField(0, v8::Persistent<v8::Object>::New(B));
>>
>
> If i'm not sorely mistaken, you do not need a Persistent handle for that
> purpose. If B is-a Native and was created from JS code then it will already
> have a Persistent handle (somewhere), and a non-persistent Handle to it is
> the same as having a reference to it in JS (if i'm not sorely mistaken).
>
>
So you suggest storing a v8::Local in internal field, instead of Persistent?
That does not make much sense to me: local handles are stack-allocated and
this will crash badly once the HandleScope is destroyed...


O.


> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
>
>  --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to