Good to know that returning would work too. I am quite new to v8. I think you oversaw the "!" (so "!obj->IsObject()). OR will stop on the first "true" else it will go through each expression. !obj->IsObject() will so filter the primitive values else I agree :) Regards
Am 14.04.2013 um 17:59 schrieb Stephan Beal <[email protected]>: > On Sun, Apr 14, 2013 at 5:51 PM, Bodo Kaiser <[email protected]> wrote: > I require scope.Close() to return a value > > That's a common misconception. i've been using v8 for 4+ years now and i > _never_ use HandleScopes (and can return values just fine). A HandleScope, > from what i can gather, is just a hint to the GC to help clean up > temporary/local-only values. > > . My sorrow is that I could get problems with GC because I did not close the > scope or something. > But you do not confirm these sorrows? > > When you call a function from JS: > > myFunction() > > and that then calls your C++ InvocationCallback, there is an implicit scope > being created in the call, so there is no need to create an extra one in your > app (unless you are calling the code from C++ without first going through the > JS engine, but such cases are rare in practice). > > > To the second: > Yes that is why there is args[0]->IsArray() > > That's my point: IsArray() is useless here because the order of operations > ensure that IsObject() will always trump IsArray(). i.e. if it's an array > then IsObject() will return true and the IsArray() call is not needed (it > will never actually be called due to the short-circuiting logic of the OR > operator). (NOTE, however, that i am ASSUMING (without having tested), that > IsObject() will indeed return true for a Function or Array Object. The API > docs are not clear on this distinction.) > > -- > ----- stephan beal > http://wanderinghorse.net/home/stephan/ > http://gplus.to/sgbeal > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to a topic in the Google > Groups "v8-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/v8-users/Q5D2lsbYb1M/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
