convertJSObjectCallAsConstructorCallback function

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

Implementation

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