JSValue.newArrayBufferCopy constructor

JSValue.newArrayBufferCopy(
  1. JSContext ctx,
  2. Uint8List buf,
  3. int len, {
  4. bool autoDispose = true,
})

JS_NewArrayBufferCopy

Implementation

factory JSValue.newArrayBufferCopy(
  JSContext ctx,
  Uint8List buf,
  int len, {
  bool autoDispose = true,
}) =>
    JSValue(
      ctx,
      calloc.call<JSValue_>(sizeOf<JSValue_>())
        ..ref = JS_NewArrayBufferCopy(
          ctx.ref,
          buf.toCAny() as Pointer<Uint8>,
          len,
        ),
      autoDispose: autoDispose,
    );