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:
Tóth Béla
2021-07-27 12:25:52 +02:00
committed by GitHub
parent d69fe41085
commit d99905aca6
6 changed files with 437 additions and 0 deletions
+4
View File
@@ -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);
/**
* @}
+14
View File
@@ -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;
/**
* @}
*/