Implement container operators API function (#4697)
Basically re-opening and updating #4275 Co-authored-by: bence gabor kis <kisbg@inf.u-szeged.hu> JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu Co-authored-by: bence gabor kis <kisbg@inf.u-szeged.hu>
This commit is contained in:
@@ -434,6 +434,10 @@ jerry_value_t jerry_create_container (jerry_container_type_t container_type,
|
||||
jerry_length_t arguments_list_len);
|
||||
jerry_container_type_t jerry_get_container_type (const jerry_value_t value);
|
||||
jerry_value_t jerry_get_array_from_container (jerry_value_t value, bool *is_key_value_p);
|
||||
jerry_value_t jerry_container_operation (jerry_container_operation_t operation,
|
||||
jerry_value_t container,
|
||||
jerry_value_t *arguments,
|
||||
uint32_t arguments_number);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -749,6 +749,20 @@ typedef enum
|
||||
JERRY_CONTAINER_TYPE_WEAKSET, /**< WeakSet type */
|
||||
} jerry_container_type_t;
|
||||
|
||||
/**
|
||||
* Container operations
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
JERRY_CONTAINER_OP_ADD, /**< Set/WeakSet add operation */
|
||||
JERRY_CONTAINER_OP_GET, /**< Map/WeakMap get operation */
|
||||
JERRY_CONTAINER_OP_SET, /**< Map/WeakMap set operation */
|
||||
JERRY_CONTAINER_OP_HAS, /**< Set/WeakSet/Map/WeakMap has operation */
|
||||
JERRY_CONTAINER_OP_DELETE, /**< Set/WeakSet/Map/WeakMap delete operation */
|
||||
JERRY_CONTAINER_OP_SIZE, /**< Set/WeakSet/Map/WeakMap size operation */
|
||||
JERRY_CONTAINER_OP_CLEAR, /**< Set/Map clear operation */
|
||||
} jerry_container_operation_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user