JSObjectMakeTypedArrayWithArrayBufferAndOffset

Function JSObjectMakeTypedArrayWithArrayBufferAndOffset 

Source
pub unsafe extern "C-unwind" fn JSObjectMakeTypedArrayWithArrayBufferAndOffset(
    ctx: JSContextRef,
    array_type: JSTypedArrayType,
    buffer: JSObjectRef,
    byte_offset: usize,
    length: usize,
    exception: *mut JSValueRef,
) -> JSObjectRef
Available on crate features JSBase and JSTypedArray and JSValueRef only.
Expand description

Creates a JavaScript Typed Array object from an existing JavaScript Array Buffer object with the given offset and length.

Parameter ctx: The execution context to use.

Parameter arrayType: A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned.

Parameter buffer: An Array Buffer object that should be used as the backing store for the created JavaScript Typed Array object.

Parameter byteOffset: The byte offset for the created Typed Array. byteOffset should aligned with the element size of arrayType.

Parameter length: The number of elements to include in the Typed Array.

Parameter exception: A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Returns: A JSObjectRef that is a Typed Array or NULL if there was an error. The backing store of the Typed Array will be buffer.

ยงSafety

  • ctx must be a valid pointer.
  • buffer must be a valid pointer.
  • exception must be a valid pointer.