Constructor

JavaScriptCoreValuenew_typed_array

Declaration [src]

JSCValue*
jsc_value_new_typed_array (
  JSCContext* context,
  JSCTypedArrayType type,
  gsize length
)

Description [src]

Create a new typed array containing a given amount of elements.

Create a JSCValue referencing a new typed array with space for length elements of a given type. As all typed arrays must have an associated ArrayBuffer, a new one of suitable size will be allocated to store the elements, which will be initialized to zero.

The type must not be JSC_TYPED_ARRAY_NONE.

Available since:2.38

Parameters

context JSCContext
 

A JSCContext.

 The data is owned by the caller of the function.
type JSCTypedArrayType
 

The type of array elements.

length gsize
 

Number of elements in the array.

Return value

Returns: JSCValue
 

A JSCValue.

 The caller of the function takes ownership of the data, and is responsible for freeing it.