[webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Jack Wootton
Hi all, I'm attempting to use the function JSObjectMakeFunction described here: http://gemma.apple.com/documentation/Carbon/Reference/WebKit_JavaScriptCore_Ref/JSObjectRef/index.html I would like to call a JavaScript function from C. I assume the following is required: 1. Create a function

Re: [webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Kalle Vahlman
2009/6/1 Jack Wootton jackwoot...@gmail.com: Hi all, Hi! I'm attempting to use the function JSObjectMakeFunction described here: http://gemma.apple.com/documentation/Carbon/Reference/WebKit_JavaScriptCore_Ref/JSObjectRef/index.html I would like to call a JavaScript function from C. I

Re: [webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Jack Wootton
It seems some casting is required for this though? JSValueRef JSObjectCallAsFunction( JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception); The above function accepts a JSObjectRef

Re: [webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Darin Adler
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

Re: [webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Maciej Stachowiak
On Jun 1, 2009, at 8:29 AM, Jack Wootton wrote: It seems some casting is required for this though? JSValueRef JSObjectCallAsFunction( [snip] The above function accepts a JSObjectRef object. However JSValueRef JSObjectGetProperty( [snip] returns JSValueRef Setting aside the

Re: [webkit-dev] JSObjectMakeFunction question

2009-06-01 Thread Maciej Stachowiak
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