JSObjectCallAsFunctionCallback typedef

Pointer<NativeType> JSObjectCallAsFunctionCallback (
  1. Pointer<NativeType> ctx,
  2. Pointer<NativeType> function,
  3. Pointer<NativeType> thisObject,
  4. Uint32 argumentCount,
  5. Pointer<Pointer<NativeType>> arguments,
  6. Pointer<Pointer<NativeType>> exception
)

typedef JSObjectCallAsFunctionCallback The callback invoked when an object is called as a function. ctx The execution context to use. function A JSObject that is the function being called. thisObject A JSObject that is the 'this' variable in the function's scope. argumentCount An integer count of the number of arguments in arguments. arguments A JSValue array of the arguments passed to the function. exception A pointer to a JSValueRef in which to return an exception, if any. @result 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. typedef JSValueRef (JSObjectCallAsFunctionCallback) (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef exception);

Implementation

typedef JSObjectCallAsFunctionCallback = Pointer Function(
    Pointer ctx,
    Pointer function,
    Pointer thisObject,
    Uint32 argumentCount,
    Pointer<Pointer> arguments,
    Pointer<Pointer> exception);