allocate static method

Implementation

static Pointer<JSClassDefinition> allocate(
  int version,
  int /*JSClassAttributes*/ attributes,
  Pointer<Utf8> className,
  JSClassRef parentClass,
  Pointer<JSStaticValue> staticValues,
  Pointer<JSStaticFunction> staticFunctions,
  Pointer<NativeFunction<JSObjectInitializeCallback>> initialize,
  Pointer<NativeFunction<JSObjectFinalizeCallback>> finalize,
  Pointer<NativeFunction<JSObjectHasPropertyCallback>> hasProperty,
  Pointer<NativeFunction<JSObjectGetPropertyCallback>> getProperty,
  Pointer<NativeFunction<JSObjectSetPropertyCallback>> setProperty,
  Pointer<NativeFunction<JSObjectDeletePropertyCallback>> deleteProperty,
  Pointer<NativeFunction<JSObjectGetPropertyNamesCallback>> getPropertyNames,
  Pointer<NativeFunction<JSObjectCallAsFunctionCallback>> callAsFunction,
  Pointer<NativeFunction<JSObjectCallAsConstructorCallback>> callAsConstructor,
  Pointer<NativeFunction<JSObjectHasInstanceCallback>> hasInstance,
  Pointer<NativeFunction<JSObjectConvertToTypeCallback>> convertToType,
) {
  final Pointer<JSClassDefinition> result = calloc.call(1);
  result.ref
    ..version = version
    ..attributes = attributes
    ..className = className
    ..parentClass = parentClass
    ..staticValues = staticValues
    ..staticFunctions = staticFunctions
    ..initialize = initialize
    ..finalize = finalize
    ..hasProperty = hasProperty
    ..getProperty = getProperty
    ..setProperty = setProperty
    ..deleteProperty = deleteProperty
    ..getPropertyNames = getPropertyNames
    ..callAsFunction = callAsFunction
    ..callAsConstructor = callAsConstructor
    ..hasInstance = hasInstance
    ..convertToType = convertToType;
  return result;
}