create method

Implementation

Pointer<JSObjectRef.JSClassDefinition> create() {
  Pointer<JSObjectRef.JSStaticValue> staticValues =
      this.staticValues == null || this.staticValues!.isEmpty
          ? nullptr
          : this.staticValues!.createArray();
  Pointer<JSObjectRef.JSStaticFunction> staticFunctions =
      this.staticFunctions == null || this.staticFunctions!.isEmpty
          ? nullptr
          : this.staticFunctions!.createArray();
  return JSObjectRef.JSClassDefinitionPointer.allocate(
    version: version,
    attributes: jSClassAttributesToCEnum(attributes),
    className: className.toNativeUtf8(),
    parentClass: parentClass == null ? nullptr : parentClass!.pointer,
    staticValues: staticValues,
    staticFunctions: staticFunctions,
    initialize: initialize ?? nullptr,
    finalize: finalize ?? nullptr,
    hasProperty: hasProperty ?? nullptr,
    getProperty: getProperty ?? nullptr,
    setProperty: setProperty ?? nullptr,
    deleteProperty: deleteProperty ?? nullptr,
    getPropertyNames: getPropertyNames ?? nullptr,
    callAsFunction: callAsFunction ?? nullptr,
    callAsConstructor: callAsConstructor ?? nullptr,
    hasInstance: hasInstance ?? nullptr,
    convertToType: convertToType ?? nullptr,
  );
}