Function

JSObjectMakeTypedArray(_:_:_:_:)

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

Declaration

func JSObjectMakeTypedArray(_ ctx: JSContextRef!, _ arrayType: JSTypedArrayType, _ length: Int, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSObjectRef!

Parameters

ctx

The execution context to use.

arrayType

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

length

The number of elements to be in the new Typed Array.

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.

Return Value

A JSObjectRef that is a Typed Array with all elements set to zero or NULL if there was an error.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software