JSStaticFunction.create constructor

JSStaticFunction.create({
  1. String? name,
  2. JSObjectCallAsFunctionCallback? callAsFunction,
  3. int attributes = 0,
  4. bool autoDispose = true,
})

Implementation

JSStaticFunction.create({
  String? name,
  JSObjectCallAsFunctionCallback? callAsFunction,
  int attributes = 0,
  bool autoDispose = true,
}) {
  _callAsFunctionNC = callAsFunctionCallbackDartToNativeConverter(
    callAsFunction,
  );
  _ref = JSStaticFunction_Pointer.alloc(
    name: name,
    callAsFunction: _callAsFunctionNC?.nativeFunction ?? nullptr,
    attributes: attributes,
  );
  attach(calloc.nativeFree, _ref.cast(), autoDispose: autoDispose);
}