• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright JS Foundation and other contributors, http://js.foundation
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ECMA_PROXY_OBJECT_H
17 #define ECMA_PROXY_OBJECT_H
18 
19 #include "ecma-globals.h"
20 
21 /** \addtogroup ecma ECMA
22  * @{
23  *
24  * \addtogroup ecmaproxyobject ECMA Proxy object related routines
25  * @{
26  */
27 
28 #if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
29 
30 ecma_object_t *
31 ecma_proxy_create (ecma_value_t target,
32                    ecma_value_t handler);
33 
34 ecma_object_t *
35 ecma_proxy_create_revocable (ecma_value_t target,
36                              ecma_value_t handler);
37 
38 ecma_value_t
39 ecma_proxy_revoke_cb (const ecma_value_t function_obj,
40                       const ecma_value_t this_val,
41                       const ecma_value_t args_p[],
42                       const ecma_length_t args_count);
43 
44 jmem_cpointer_t
45 ecma_proxy_object_prototype_to_cp (ecma_value_t proto);
46 
47 ecma_value_t
48 ecma_proxy_object_find (ecma_object_t *obj_p,
49                         ecma_string_t *prop_name_p);
50 
51 /* Interal operations */
52 
53 ecma_value_t
54 ecma_proxy_object_get_prototype_of (ecma_object_t *obj_p);
55 
56 ecma_value_t
57 ecma_proxy_object_set_prototype_of (ecma_object_t *obj_p,
58                                     ecma_value_t proto);
59 
60 ecma_value_t
61 ecma_proxy_object_is_extensible (ecma_object_t *obj_p);
62 
63 ecma_value_t
64 ecma_proxy_object_prevent_extensions (ecma_object_t *obj_p);
65 
66 ecma_value_t
67 ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p,
68                                                ecma_string_t *prop_name_p,
69                                                ecma_property_descriptor_t *prop_desc_p);
70 
71 ecma_value_t
72 ecma_proxy_object_define_own_property (ecma_object_t *obj_p,
73                                        ecma_string_t *prop_name_p,
74                                        const ecma_property_descriptor_t *prop_desc_p);
75 
76 ecma_value_t
77 ecma_proxy_object_has (ecma_object_t *obj_p,
78                        ecma_string_t *prop_name_p);
79 
80 ecma_value_t
81 ecma_proxy_object_get (ecma_object_t *obj_p,
82                        ecma_string_t *prop_name_p,
83                        ecma_value_t receiver);
84 
85 ecma_value_t
86 ecma_proxy_object_set (ecma_object_t *obj_p,
87                        ecma_string_t *prop_name_p,
88                        ecma_value_t name,
89                        ecma_value_t receiver);
90 
91 ecma_value_t
92 ecma_proxy_object_delete_property (ecma_object_t *obj_p,
93                                    ecma_string_t *prop_name_p);
94 
95 ecma_value_t
96 ecma_proxy_object_enumerate (ecma_object_t *obj_p);
97 
98 ecma_collection_t *
99 ecma_proxy_object_own_property_keys (ecma_object_t *obj_p);
100 
101 ecma_value_t
102 ecma_proxy_object_call (ecma_object_t *obj_p,
103                         ecma_value_t this_argument,
104                         const ecma_value_t *args_p,
105                         ecma_length_t argc);
106 
107 ecma_value_t
108 ecma_proxy_object_construct (ecma_object_t *obj_p,
109                              ecma_object_t *new_target_p,
110                              const ecma_value_t *args_p,
111                              ecma_length_t argc);
112 
113 #endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
114 
115 /**
116  * @}
117  * @}
118  */
119 
120 #endif /* !ECMA_PROXY_OBJECT_H */
121