alloc static method

JSStaticFunctionRef alloc({
  1. String? name,
  2. Pointer<NativeFunction<JSObjectCallAsFunctionCallback_>>? callAsFunction,
  3. int attributes = 0,
})

Implementation

static JSStaticFunctionRef alloc({
  String? name,
  Pointer<NativeFunction<JSObjectCallAsFunctionCallback_>>? callAsFunction,
  int attributes = 0,
}) {
  final pointer = calloc<JSStaticFunction_>(1);
  pointer.ref
    ..name = name?.toNativeUtf8() ?? nullptr
    ..callAsFunction = callAsFunction ?? nullptr
    ..attributes = attributes;
  return pointer;
}