2010/11/19 Ben Noordhuis <[email protected]>:
> On Fri, Nov 19, 2010 at 09:30, ondras <[email protected]> wrote:
>> I need to check (in C++) whether a given v8::Object is an instance of
>> a given v8::Function. The problem is that I don't have the adequate
>> v8::FunctionTemplate (to call HasInstance) and there is no way to get
>> from Function to its Template...
>
> Something like this?
>
> bool isInstanceOf =
> function->Equals(Function::Cast(*object)->GetPrototype());
>
> You might need to walk the whole prototype chain.
>
Yeah, with the addition that I must compare object->GetPrototype()
with function->Get("prototype"). And walking the prototype chain is
painful :-(
O.
> --
> 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