alloc static method

Implementation

static JSStaticValueRef alloc({
  String? name,
  Pointer<NativeFunction<JSObjectGetPropertyCallback_>>? getProperty,
  Pointer<NativeFunction<JSObjectSetPropertyCallback_>>? setProperty,
  int attributes = 0,
}) {
  final pointer = calloc<JSStaticValue_>(1);
  pointer.ref
    ..name = name?.toNativeUtf8() ?? nullptr
    ..setProperty = setProperty ?? nullptr
    ..getProperty = getProperty ?? nullptr
    ..attributes = attributes;
  return pointer;
}