JSObjectMakeTypedArray

Function JSObjectMakeTypedArray 

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

Creates a JavaScript Typed Array object with the given number of elements.

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 length: The number of elements to be in the new 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 with all elements set to zero or NULL if there was an error.

ยงSafety

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