That was my first choise, but as you said couldnt find the way of getting the template :( So, I'll stick with ObjectProtoToString() for now.
On Thu, Jun 10, 2010 at 10:48 AM, Marco Rogers <[email protected]>wrote: > If you can actually get the FunctionTemplate for the primitive box > objects, you can use FunctionTemplate::HasInstance. > > > http://marcorogers.com/blog/static/v8/doxygen/classv8_1_1FunctionTemplate.html > > So you would do something like this: > > Handle<FunctionTemplate> boolclass = > Boolean.GetFunctionTemplate(); // This is totally pseudo-code because > I don't know the syntax. > > if(boolclass.HasInstance(myObject)) { > // it's an instance or subclass of the Boolean object > } > > But I don't know how to actually get the FunctionTemplate for the > Boolean class or any other primitive in v8. I've never tried it. If > you find out please post back here. > > :Marco > > On Jun 9, 3:54 pm, vlad vladbph <[email protected]> wrote: > > as a matter of fact I tried and it returns not empty value :)... > > anyway if ObjectProtoToString() > > would do the job, I'm fine. > > > > On Wed, Jun 9, 2010 at 12:21 PM, Stephan Beal <[email protected]> > wrote: > > > On Wed, Jun 9, 2010 at 7:17 PM, vlad vladbph <[email protected]> > wrote: > > > > >> true for JS side, but I would like to check the inheritance from > simple > > >> types on C++ . I can use ObjectProtoToString() for that I guess. > Another way > > >> I can request global instanceof, but how to pass obj and type > correctly to > > >> it... > > > > >> v8::Handle<v8::Value> iof = > g->Get(v8::String::New("instanceof")); > > > > > instanceof is not a function, but a language construct. You won't be > able > > > to get at it, i think, in the same way that you can't get a reference > to > > > "function". > > > > > -- > > > ----- 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 > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
