convertJSObjectConvertToTypeCallback function

JSValueRef convertJSObjectConvertToTypeCallback(
  1. JSContextRef ctx,
  2. JSObjectRef object,
  3. int type,
  4. Pointer<JSValueRef> exception,
  5. JSValue fn(
    1. JSContext context,
    2. JSObject object,
    3. JSType type,
    4. JSException exception,
    ),
)

Implementation

JSValueRef convertJSObjectConvertToTypeCallback(
  JSContextRef ctx,
  JSObjectRef object,
  int /*JSType*/ type,
  Pointer<JSValueRef> exception,
  JSValue Function(JSContext context, JSObject object, JSType type, JSException exception) fn,
) {
  final JSContext context = JSContext(ctx);
  return fn(context, JSObject(context, object), JSType.values[type], JSException(context, exception)).ref;
}