JSCFunctionListEntry.defCGetsetMagic constructor

JSCFunctionListEntry.defCGetsetMagic(
  1. JSContext ctx,
  2. String name, {
  3. JSCFunctionGetterMagicFunction? getFunc,
  4. JSCFunctionSetterMagicFunction? setFunc,
  5. int magic = 0,
  6. bool autoDispose = true,
})

Implementation

factory JSCFunctionListEntry.defCGetsetMagic(
  JSContext ctx,
  String name, {
  JSCFunctionGetterMagicFunction? getFunc,
  JSCFunctionSetterMagicFunction? setFunc,
  int magic = 0,
  bool autoDispose = true,
}) {
  return JSCFunctionListEntry._(
    ctx,
    name: name,
    propFlags: JSProp.CONFIGURABLE,
    defType: JSDef.CGETSET,
    magic: magic,
    union: JSCFuntionListEntryUnion(
      getset: JSCFunctionListEntryGetset(
        JSCFunctionType.defGetterMagic(ctx, func: getFunc),
        JSCFunctionType.defSetterMagic(ctx, func: setFunc),
      ),
    ),
    autoDispose: autoDispose,
  );
}