Add TypedArray C API (#2165)

New API functions added:
 - jerry_value_is_typedarray
 - jerry_create_typedarray
 - jerry_create_typedarray_for_arraybuffer_sz
 - jerry_create_typedarray_for_arraybuffer
 - jerry_get_typedarray_type
 - jerry_get_typedarray_length
 - jerry_get_typedarray_buffer

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Péter Gál
2018-02-06 08:01:32 +01:00
committed by László Langó
parent 0cc98340c3
commit 8041953a7a
6 changed files with 1168 additions and 1 deletions
@@ -226,7 +226,7 @@ ecma_set_typedarray_element (lit_utf8_byte_t *dst_p, /**< the location in the in
* @return ecma value of the new typedarray object
* Returned value must be freed with ecma_free_value
*/
static ecma_value_t
ecma_value_t
ecma_typedarray_create_object_with_length (ecma_length_t array_length, /**< length of the typedarray */
ecma_object_t *proto_p, /**< prototype object */
uint8_t element_size_shift, /**< the size shift of the element length */
@@ -57,6 +57,10 @@ bool ecma_op_typedarray_define_index_prop (ecma_object_t *obj_p,
bool ecma_op_typedarray_set_index_prop (ecma_object_t *obj_p, uint32_t index, ecma_value_t value);
ecma_value_t ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p,
ecma_length_t array_length);
ecma_value_t ecma_typedarray_create_object_with_length (ecma_length_t array_length,
ecma_object_t *proto_p,
uint8_t element_size_shift,
lit_magic_string_id_t class_id);
/**
* @}