typedArrayBytes method

Bytes typedArrayBytes({
  1. JSValuePointer? exception,
})

Returns a temporary pointer to the backing store of a JavaScript Typed Array object. The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls. exception (JSValueRef*) A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Implementation

Bytes typedArrayBytes({
  JSValuePointer? exception,
}) {
  return Bytes(
      JSTypedArray.jSObjectGetTypedArrayBytesPtr(context.pointer, pointer,
          (exception ?? JSValuePointer(nullptr)).pointer),
      JSTypedArray.jSObjectGetTypedArrayLength(context.pointer, pointer,
          (exception ?? JSValuePointer(nullptr)).pointer));
}