[webkit-dev] JSObjectCallAsFunctionCallback question
darin at apple.com
Thu May 14 19:29:45 PDT 2009
On May 14, 2009, at 7:03 PM, Xiong wrote:
> 1 what is the purpose of the "JSObjectRef function" variable? In
> my case, we never use.
functions are objects. Like other objects they can have properties.
This argument is passed to your C implementation so that it can get
access to properties of the function object if it has some reason to.
In many cases there is no need to do this.
> 2 In this function, i want to get the propertyName of the method,
> in this case, we need "getValues", can be implemented ?
No, there's no way to do that, for a good architectural reason.
create an object with a prototype that has functions stored in its
taking that function and storing it somewhere else, in a property with
another name. When the function is called, it’s just an object, and
there’s no way to go back in time and find out where that object came
Consider the similar situation of a data property. When you get the
length of an array, it's a number 1, not a number 1 that knows it came
from a property named "length".
More information about the webkit-dev