thanks for a prompt response!
>> 1) why there is no HandleScope in this method? When are those Local
>> handles destroyed?
>
> See
> http://groups.google.com/group/v8-users/browse_thread/thread/27fcbb1e7da0b77d/1d65d64fed5c8480?lnk=gst&q=It%27s+option+1%3A+a+handle+scope+is+set+up+for+callbacks%2C+always%2C+so+if#1d65d64fed5c8480
>
> A handle scope is created by v8 for each callback invocation.
>
Thanks for the link. That basically covers my question. So, is it safe
to return a handle from callback, *if* I don't create a (my own
explicit) HandleScope, okay?
>> 2) what exactly is the difference between v8::Handle and v8::Local ?
>
> Handle is the super class of both Local and Persistent.
I already figured this from the inheritance diagram (in autogenerated
docs), but it is still unclear to me what is the (from the
functionality point of view) difference beween writing
v8::Handle<v8::String> x = ...
and
v8::Local<v8::String> y = ...
Thanks,
Ondrej
Well, I am getting more and more puzzled :) This code:
v8::Handle<v8::String> x = v8::String::New("hello");
creates a new local handle which is not registered in current handle
scope? When is this JS value GC'ed then? Should I use this instead:
v8::Handle<v8::String> x =
v8::Handle<v8::String>::New(v8::String::New("hello")) ?
O.
But this is only true for non-callback functions, because those
specified as argument to FunctionTemplate receive a handle scope
automatically, correct?
O.