Updates:
Status: WorkingAsIntended
Comment #1 on issue 1038 by [email protected]: Wrong This object in
function called from Object::SetCallAsFunctionHandler
http://code.google.com/p/v8/issues/detail?id=1038
The nature of call as function handlers is different from functions. If you
have
o.f()
and f is a function then 'this' and 'holder' will be the same, namely o.
If f is an object you really should not be able to call it at all. We
provide that option to allow simple stuff that is needed for browsers such
as accessing collections using call instead of array index syntax:
collection[i] and collection(i). What you usually need is to get the object
that is called as a function in the callback and therefore that is both
the 'this' and the 'holder' here.
Through the API you can attach extra information to this object that has a
call handler and use that to create a link to other stuff you might need in
the callback.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev