Type Definition javascriptcore_sys::JSObjectCallAsFunctionCallback [] [src]

type JSObjectCallAsFunctionCallback = Option<unsafe extern "C" fn(_: JSContextRef, _: JSObjectRef, _: JSObjectRef, _: usize, _: *const JSValueRef, _: *mut JSValueRef) -> *const OpaqueJSValue>;

The callback invoked when an object is called as a function.

Returns a JSValue that is the function's return value.

If you named your function CallAsFunction, you would declare it like this:

JSValueRef
CallAsFunction(JSContextRef ctx, JSObjectRef function,
               JSObjectRef thisObject,
               size_t argumentCount, const JSValueRef arguments[],
               JSValueRef* exception);

If your callback were invoked by the JavaScript expression myObject.myFunction(), function would be set to myFunction, and thisObject would be set to myObject.

If this callback is NULL, calling your object as a function will throw an exception.