Files
jerryscript/jerry-core/ecma/operations/ecma-map-object.h
T
Robert Fancsik d2931c6e40 Rework Map object (#2760)
This patch reworks the core of the builtin Map object.

Advantages:
 - Provide sublinear access time for the elements via Lcache and property hashmap
 - This implementation is suitable for the builtin Set object as well

Also add the missing 'forEach' routine for the builtin object as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-04-17 14:50:03 +02:00

48 lines
1.7 KiB
C

/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECMA_MAP_OBJECT_H
#define ECMA_MAP_OBJECT_H
#include "ecma-globals.h"
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
/** \addtogroup ecma ECMA
* @{
*
* \addtogroup ecmamaphelpers ECMA builtin map helper functions
* @{
*/
ecma_value_t ecma_op_map_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
ecma_value_t ecma_op_map_size (ecma_value_t this_arg);
ecma_value_t ecma_op_map_get (ecma_value_t this_arg, ecma_value_t key_arg);
ecma_value_t ecma_op_map_foreach (ecma_value_t this_arg, ecma_value_t predicate, ecma_value_t predicate_this_arg);
ecma_value_t ecma_op_map_has (ecma_value_t this_arg, ecma_value_t key_arg);
ecma_value_t ecma_op_map_set (ecma_value_t this_arg, ecma_value_t key_arg, ecma_value_t value_arg);
void ecma_op_map_clear_map (ecma_map_object_t *map_object_p);
ecma_value_t ecma_op_map_clear (ecma_value_t this_arg);
ecma_value_t ecma_op_map_delete (ecma_value_t this_arg, ecma_value_t key_arg);
/**
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#endif /* !ECMA_MAP_OBJECT_H */