convertJSObjectCallAsFunctionCallback function

JSValueRef convertJSObjectCallAsFunctionCallback(
  1. JSContextRef ctx,
  2. JSObjectRef function,
  3. JSObjectRef thisObject,
  4. int argumentCount,
  5. Pointer<JSValueRef> arguments,
  6. Pointer<JSValueRef> exception,
  7. JSValue fn(
    1. JSContext context,
    2. JSObject function,
    3. JSObject thisObject,
    4. List<JSValue> arguments,
    5. JSException exception,
    ),
)

Implementation

JSValueRef convertJSObjectCallAsFunctionCallback(
  JSContextRef ctx,
  JSObjectRef function,
  JSObjectRef thisObject,
  int argumentCount,
  Pointer<JSValueRef> arguments,
  Pointer<JSValueRef> exception,
  JSValue Function(JSContext context, JSObject function, JSObject thisObject, List<JSValue> arguments, JSException exception) fn,
) {
  final JSContext context = JSContext(ctx);
  return fn(context, JSObject(context, function), JSObject(context, thisObject), JSValueConverter.toJSValues(context, argumentCount, arguments), JSException(context, exception)).ref;
}