On Fri, Sep 12, 2008 at 1:02 AM, Christian Plesner Hansen
<[EMAIL PROTECTED]> wrote:
>
> The problem is that when you construct an instance of the traced
> object with "new Foo()" the prototype of the result is set to the
> prototype of the ObjectTemplate created in TracedObjectCallback, not
> the prototype of Foo.  What you need to do is set the prototype
> manually, like so:
>
>  ...
>  Handle<Object> result = traced_obj->NewInstance();
>  Handle<Function> constructor = Handle<Function>::Cast(args.Data());
>  result->Set(v8::String::New("__proto__"), 
> constructor->Get(v8::String::New("prototype")));
>  ...
>

That works, thanks a lot.

-Jey Kottalam

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to