JSCFuntionListEntryUnion constructor

JSCFuntionListEntryUnion({
  1. int i32 = 0,
  2. int i64 = 0,
  3. double f64 = 0.0,
  4. String str = '',
  5. JSCFunctionListEntryFunc? func,
  6. JSCFunctionListEntryGetset? getset,
  7. JSCFunctionListEntryAlias? alias,
  8. JSCFunctionListEntryProplist? proplist,
  9. bool autoDispose = true,
})

Implementation

JSCFuntionListEntryUnion({
  this.i32 = 0,
  this.i64 = 0,
  this.f64 = 0.0,
  this.str = '',
  this.func,
  this.getset,
  this.alias,
  this.proplist,
  bool autoDispose = true,
}) : _ref =
         calloc.call(sizeOf<JSCFunctionListEntryUnion_>())
           ..ref.i32 = i32
           ..ref.i64 = i64
           ..ref.f64 = f64
           ..ref.str = str.toNativeUtf8() {
  if (func != null) {
    _ref.ref.func = func!.ref.ref;
  }
  if (getset != null) {
    _ref.ref.getset = getset!.ref.ref;
  }
  if (alias != null) {
    _ref.ref.alias = alias!.ref.ref;
  }
  if (proplist != null) {
    _ref.ref.prop_list = proplist!.ref.ref;
  }
  attach(calloc.nativeFree, _ref.cast(), autoDispose: autoDispose);
}