So, methods should be added to a FunctionTemplate's PrototypeTemplate, but accessors should be added to the individual InstanceTemplate?
On Sep 8, 1:34 am, "Kasper Lund" <[EMAIL PROTECTED]> wrote: > The reason there is a difference between 'this' and 'holder' is > prototype chain lookup. If you call a function on an object and the > function isn't found in the object itself, V8 consults the prototype > chain of the object. The 'holder' is the object where the function was > found during lookup -- and 'this' is the object where the lookup was > initiated. > > Cheers, > Kasper > > On Mon, Sep 8, 2008 at 7:29 AM, CGamesPlay <[EMAIL PROTECTED]> wrote: > > > What is a function call's Holder()? When is it different from This()? > > > Based on experimental evidence, it looks like the Holder() is always > > This() in a method call, but in an accessor, Holder() is the global > > object. The only thing I can tell form the source code is that > > Holder() comes from the V8 internals and This() is the last thing put > > on the stack before the call. > > > More importantly, I found that when using an accessor, you have to use > > info.This(), *not* info.Holder(), like the Embedder's Guide would have > > you believe. I just want to know what the technical meanings are. --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
