jerryscript/jerry-core/ecma/operations/ecma-proxy-object.h
Szilagyi Adam ff47c84bc4
Rework Object's [[OwnPropertyKeys]] (#4001)
I've removed the ecma_op_object_get_property_names method, and implemented the following ones:
- ecma_op_object_own_property_keys: this is now the internal [[OwnPropertyKeys]] method
- ecma_op_object_enumerate: this is used for the for-in iterator
- ecma_object_sort_property_names: this is used for sorting the property names of an object
- ecma_object_list_lazy_property_names: this is for getting the lazy instantiated properties
- ecma_object_prop_name_is_duplicated: this is for checking if a given property is duplicated in an object

Also the for-in operation with Proxy object works with this patch, #3992 should be closed

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-07-27 11:37:04 +02:00

118 lines
3.5 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_PROXY_OBJECT_H
#define ECMA_PROXY_OBJECT_H
#include "ecma-globals.h"
/** \addtogroup ecma ECMA
* @{
*
* \addtogroup ecmaproxyobject ECMA Proxy object related routines
* @{
*/
#if ENABLED (JERRY_BUILTIN_PROXY)
ecma_object_t *
ecma_proxy_create (ecma_value_t target,
ecma_value_t handler);
ecma_object_t *
ecma_proxy_create_revocable (ecma_value_t target,
ecma_value_t handler);
ecma_value_t
ecma_proxy_revoke_cb (const ecma_value_t function_obj,
const ecma_value_t this_val,
const ecma_value_t args_p[],
const uint32_t args_count);
jmem_cpointer_t
ecma_proxy_object_prototype_to_cp (ecma_value_t proto);
ecma_value_t
ecma_proxy_object_find (ecma_object_t *obj_p,
ecma_string_t *prop_name_p);
/* Interal operations */
ecma_value_t
ecma_proxy_object_get_prototype_of (ecma_object_t *obj_p);
ecma_value_t
ecma_proxy_object_set_prototype_of (ecma_object_t *obj_p,
ecma_value_t proto);
ecma_value_t
ecma_proxy_object_is_extensible (ecma_object_t *obj_p);
ecma_value_t
ecma_proxy_object_prevent_extensions (ecma_object_t *obj_p);
ecma_value_t
ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p,
ecma_string_t *prop_name_p,
ecma_property_descriptor_t *prop_desc_p);
ecma_value_t
ecma_proxy_object_define_own_property (ecma_object_t *obj_p,
ecma_string_t *prop_name_p,
const ecma_property_descriptor_t *prop_desc_p);
ecma_value_t
ecma_proxy_object_has (ecma_object_t *obj_p,
ecma_string_t *prop_name_p);
ecma_value_t
ecma_proxy_object_get (ecma_object_t *obj_p,
ecma_string_t *prop_name_p,
ecma_value_t receiver);
ecma_value_t
ecma_proxy_object_set (ecma_object_t *obj_p,
ecma_string_t *prop_name_p,
ecma_value_t name,
ecma_value_t receiver);
ecma_value_t
ecma_proxy_object_delete_property (ecma_object_t *obj_p,
ecma_string_t *prop_name_p);
ecma_collection_t *
ecma_proxy_object_own_property_keys (ecma_object_t *obj_p);
ecma_value_t
ecma_proxy_object_call (ecma_object_t *obj_p,
ecma_value_t this_argument,
const ecma_value_t *args_p,
uint32_t argc);
ecma_value_t
ecma_proxy_object_construct (ecma_object_t *obj_p,
ecma_object_t *new_target_p,
const ecma_value_t *args_p,
uint32_t argc);
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
/**
* @}
* @}
*/
#endif /* !ECMA_PROXY_OBJECT_H */