[webkit-dev] JSObjectMakeFunction question

Maciej Stachowiak mjs at apple.com
Mon Jun 1 08:58:38 PDT 2009


On Jun 1, 2009, at 8:55 AM, Darin Adler wrote:

> On Jun 1, 2009, at 8:29 AM, Jack Wootton wrote:
>
>> It seems some casting is required for this though?
>
> Yes, conversion to JSObjectRef is needed, although you don’t have to  
> do any casting.
>
> You can call JSValueToObject to turn the value into an object,  
> making the appropriate object wrapper for non-object types.

That's a possible alternative to my suggestion (in other email)l. In  
this particular case, it would be fruitless to attempt to call the  
object wrapper for a primitive value as a function, so it's may be  
better idea to do the check up front.

Regards,
Maciej



More information about the webkit-dev mailing list