I require scope.Close() to return a value. 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?
To the second: Yes that is why there is args[0]->IsArray() Regards Am 14.04.2013 um 17:37 schrieb Stephan Beal <[email protected]>: > On Sun, Apr 14, 2013 at 5:30 PM, <[email protected]> wrote: > Hello, > > I want to use a function which acts as internal exception shortcut > unfortunately I cannot pass the current scope so I would create a new one. > Is this whole strategy valid? If not how would it look right? > > My understanding, based on previous discussions on this list, is that a > HandleScope is not needed at all if the code in question is being called from > JS space (because such a call has an implicit HandleScope around it). Based > on my own experience, your InvocationCallback and exception-thrower look > perfectly koster to me, but i would drop both of the HandleScopes - IMO they > are not needed because your InvocationCallback will be called from JS-space > in response to a Function call, and such calls have an implicit Scope > provided by the engine. > > Handle<Value> SomeMethod(const Arguments &args) { > HandleScope scope: > > > if (!args[0]->IsObject() || args[0]->IsArray()) > > > if i'm not mistaken (and i might be), IsObject() will(???) also return true > for an Array because an Array is-a Object. > > return ThrowTypeError("Argument must be a object literal."); > > > return scope.Close(args[0]->ToObject()); > > }; > > NODE_MODULE(test, init); > > > > -- > ----- 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.
