A signature requires the object either be constructed from the same
FunctionTemplate (as e.g. new MyType() does), or from a FunctionTemplate
that inherited from the signature's FunctionTemplate.

Note however that the "info.Holder" would still point at the receiver, and
not the prototype with the matching signature :/

On Sun, May 28, 2017 at 7:27 PM Zac Hansen <xax...@gmail.com> wrote:

> I create a "constructor" FunctionTemplate, create a signature from that
> FunctionTemplate, then on that FunctionTemplate's PrototypeObject
> ObjectTemplate, I create a bunch of FunctionTemplate's using the signature
> I generated before.
>
> I can call the function with objects created directly from the
> "constructor" FunctionTemplate.  But if I call it from an object with that
> object in the prototype chain, it doesn't work.
>
> base = new MyType();
> derived = Object.create(base);  // setting .__proto__ has the same behavior
>
> base.some_native_function(); <== works
>
> derived.some_native_function(); <== TypeError: Illegal invocation
>
>
>
> Anyone know what I might be doing wrong?  If I remove the signature,
> everything works fine, but then holder == this when calling with derived,
> which isn't what I want.
>
> --Zac
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> 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 v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to