JSCFunctionType.defFFF constructor

JSCFunctionType.defFFF(
  1. JSContext _ctx, {
  2. JSCFunctionFFFFunction_? func,
  3. bool autoDispose = true,
})

Implementation

JSCFunctionType.defFFF(
  this._ctx, {
  JSCFunctionFFFFunction_? func,
  bool autoDispose = true,
}) {
  _cfuncFFFFuncNC = NativeCallable.isolateLocal((double a, double b) {
    return func?.call(a, b);
  }, exceptionalReturn: 0.0);
  _ref = calloc.call(sizeOf<JSCFunctionType_>())
    ..ref.f_f_f = _cfuncFFFFuncNC!.nativeFunction;
  attach(calloc.nativeFree, _ref.cast(), autoDispose: autoDispose);
}