|
20 | 20 | #define ECMA_BUILTINS_INTERNAL |
21 | 21 | #include "ecma-builtins-internal.h" |
22 | 22 |
|
| 23 | +/** |
| 24 | + * This object has a custom dispatch function. |
| 25 | + */ |
| 26 | +#define BUILTIN_CUSTOM_DISPATCH |
23 | 27 | #define BUILTIN_INC_HEADER_NAME "ecma-builtin-map-prototype.inc.h" |
24 | 28 | #define BUILTIN_UNDERSCORED_ID map_prototype |
25 | 29 | #include "ecma-builtin-internal-routines-template.inc.h" |
|
35 | 39 | */ |
36 | 40 |
|
37 | 41 | /** |
38 | | - * The Map.prototype object's 'clear' routine |
39 | | - * |
40 | | - * See also: |
41 | | - * ECMA-262 v6, 23.1.3.1 |
42 | | - * |
43 | | - * @return ecma value |
44 | | - * Returned value must be freed with ecma_free_value. |
45 | | - */ |
46 | | -static ecma_value_t |
47 | | -ecma_builtin_map_prototype_object_clear (ecma_value_t this_arg) /**< this argument */ |
48 | | -{ |
49 | | - return ecma_op_container_clear (this_arg, LIT_MAGIC_STRING_MAP_UL); |
50 | | -} /* ecma_builtin_map_prototype_object_clear */ |
51 | | - |
52 | | -/** |
53 | | - * The Map.prototype object's 'delete' routine |
54 | | - * |
55 | | - * See also: |
56 | | - * ECMA-262 v6, 23.1.3.3 |
57 | | - * |
58 | | - * @return ecma value |
59 | | - * Returned value must be freed with ecma_free_value. |
60 | | - */ |
61 | | -static ecma_value_t |
62 | | -ecma_builtin_map_prototype_object_delete (ecma_value_t this_arg, /**< this argument */ |
63 | | - ecma_value_t key_arg) /**< key argument */ |
64 | | -{ |
65 | | - return ecma_op_container_delete (this_arg, key_arg, LIT_MAGIC_STRING_MAP_UL); |
66 | | -} /* ecma_builtin_map_prototype_object_delete */ |
67 | | - |
68 | | -/** |
69 | | - * The Map.prototype object's 'forEach' routine |
70 | | - * |
71 | | - * See also: |
72 | | - * ECMA-262 v6, 23.1.3.5 |
73 | | - * |
74 | | - * @return ecma value |
75 | | - * Returned value must be freed with ecma_free_value. |
76 | | - */ |
77 | | -static ecma_value_t |
78 | | -ecma_builtin_map_prototype_object_foreach (ecma_value_t this_arg, /**< this argument */ |
79 | | - ecma_value_t predicate, /**< callback function */ |
80 | | - ecma_value_t predicate_this_arg) /**< this argument for |
81 | | - * invoke predicate */ |
82 | | -{ |
83 | | - return ecma_op_container_foreach (this_arg, predicate, predicate_this_arg, LIT_MAGIC_STRING_MAP_UL); |
84 | | -} /* ecma_builtin_map_prototype_object_foreach */ |
85 | | - |
86 | | -/** |
87 | | - * The Map.prototype object's 'get' routine |
88 | | - * |
89 | | - * See also: |
90 | | - * ECMA-262 v6, 23.1.3.6 |
91 | | - * |
92 | | - * @return ecma value |
93 | | - * Returned value must be freed with ecma_free_value. |
94 | | - */ |
95 | | -static ecma_value_t |
96 | | -ecma_builtin_map_prototype_object_get (ecma_value_t this_arg, /**< this argument */ |
97 | | - ecma_value_t key_arg) /**< key argument */ |
98 | | -{ |
99 | | - return ecma_op_container_get (this_arg, key_arg, LIT_MAGIC_STRING_MAP_UL); |
100 | | -} /* ecma_builtin_map_prototype_object_get */ |
101 | | - |
102 | | -/** |
103 | | - * The Map.prototype object's 'has' routine |
104 | | - * |
105 | | - * See also: |
106 | | - * ECMA-262 v6, 23.1.3.7 |
107 | | - * |
108 | | - * @return ecma value |
109 | | - * Returned value must be freed with ecma_free_value. |
110 | | - */ |
111 | | -static ecma_value_t |
112 | | -ecma_builtin_map_prototype_object_has (ecma_value_t this_arg, /**< this argument */ |
113 | | - ecma_value_t key_arg) /**< key argument */ |
114 | | -{ |
115 | | - return ecma_op_container_has (this_arg, key_arg, LIT_MAGIC_STRING_MAP_UL); |
116 | | -} /* ecma_builtin_map_prototype_object_has */ |
117 | | - |
118 | | -/** |
119 | | - * The Map.prototype object's 'set' routine |
120 | | - * |
121 | | - * See also: |
122 | | - * ECMA-262 v6, 23.1.3.9 |
123 | | - * |
124 | | - * @return ecma value |
125 | | - * Returned value must be freed with ecma_free_value. |
126 | | - */ |
127 | | -static ecma_value_t |
128 | | -ecma_builtin_map_prototype_object_set (ecma_value_t this_arg, /**< this argument */ |
129 | | - ecma_value_t key_arg, /**< key argument */ |
130 | | - ecma_value_t value_arg) /**< value argument */ |
131 | | -{ |
132 | | - return ecma_op_container_set (this_arg, key_arg, value_arg, LIT_MAGIC_STRING_MAP_UL); |
133 | | -} /* ecma_builtin_map_prototype_object_set */ |
134 | | - |
135 | | -/** |
136 | | - * The Map.prototype object's 'size' getter |
137 | | - * |
138 | | - * See also: |
139 | | - * ECMA-262 v6, 23.1.3.10 |
| 42 | + * Dispatcher of the built-in's routines |
140 | 43 | * |
141 | 44 | * @return ecma value |
142 | 45 | * Returned value must be freed with ecma_free_value. |
143 | 46 | */ |
144 | | -static ecma_value_t |
145 | | -ecma_builtin_map_prototype_object_size_getter (ecma_value_t this_arg) /**< this argument */ |
| 47 | +ecma_value_t |
| 48 | +ecma_builtin_map_prototype_dispatch_routine (uint16_t builtin_routine_id, /**< built-in wide routine |
| 49 | + * identifier */ |
| 50 | + ecma_value_t this_arg, /**< 'this' argument value */ |
| 51 | + const ecma_value_t arguments_list_p[], /**< list of arguments |
| 52 | + * passed to routine */ |
| 53 | + ecma_length_t arguments_number) /**< length of arguments' list */ |
146 | 54 | { |
147 | | - return ecma_op_container_size (this_arg, LIT_MAGIC_STRING_MAP_UL); |
148 | | -} /* ecma_builtin_map_prototype_object_size_getter */ |
149 | | - |
150 | | -#if ENABLED (JERRY_ES2015) |
151 | | - |
152 | | -/** |
153 | | - * The Map.prototype object's 'entries' routine |
154 | | - * |
155 | | - * See also: |
156 | | - * ECMA-262 v6, 23.1.3.4 |
157 | | - * |
158 | | - * @return ecma value |
159 | | - * Returned value must be freed with ecma_free_value. |
160 | | - */ |
161 | | -static ecma_value_t |
162 | | -ecma_builtin_map_prototype_object_entries (ecma_value_t this_arg) /**< this argument */ |
163 | | -{ |
164 | | - return ecma_op_container_create_iterator (this_arg, |
165 | | - ECMA_ITERATOR_KEYS_VALUES, |
166 | | - LIT_MAGIC_STRING_MAP_UL, |
167 | | - ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE, |
168 | | - ECMA_PSEUDO_MAP_ITERATOR); |
169 | | -} /* ecma_builtin_map_prototype_object_entries */ |
170 | | - |
171 | | -/** |
172 | | - * The Map.prototype object's 'keys' routine |
173 | | - * |
174 | | - * See also: |
175 | | - * ECMA-262 v6, 23.1.3.8 |
176 | | - * |
177 | | - * @return ecma value |
178 | | - * Returned value must be freed with ecma_free_value. |
179 | | - */ |
180 | | -static ecma_value_t |
181 | | -ecma_builtin_map_prototype_object_keys (ecma_value_t this_arg) /**< this argument */ |
182 | | -{ |
183 | | - return ecma_op_container_create_iterator (this_arg, |
184 | | - ECMA_ITERATOR_KEYS, |
185 | | - LIT_MAGIC_STRING_MAP_UL, |
186 | | - ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE, |
187 | | - ECMA_PSEUDO_MAP_ITERATOR); |
188 | | -} /* ecma_builtin_map_prototype_object_keys */ |
189 | | - |
190 | | -/** |
191 | | - * The Map.prototype object's 'values' routine |
192 | | - * |
193 | | - * See also: |
194 | | - * ECMA-262 v6, 23.1.3.11 |
195 | | - * |
196 | | - * @return ecma value |
197 | | - * Returned value must be freed with ecma_free_value. |
198 | | - */ |
199 | | -static ecma_value_t |
200 | | -ecma_builtin_map_prototype_object_values (ecma_value_t this_arg) /**< this argument */ |
201 | | -{ |
202 | | - return ecma_op_container_create_iterator (this_arg, |
203 | | - ECMA_ITERATOR_VALUES, |
204 | | - LIT_MAGIC_STRING_MAP_UL, |
205 | | - ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE, |
206 | | - ECMA_PSEUDO_MAP_ITERATOR); |
207 | | -} /* ecma_builtin_map_prototype_object_values */ |
208 | | - |
209 | | -#endif /* ENABLED (JERRY_ES2015) */ |
210 | | - |
| 55 | + JERRY_UNUSED (arguments_number); |
| 56 | + return ecma_builtin_container_dispatch_routine (builtin_routine_id, |
| 57 | + this_arg, |
| 58 | + arguments_list_p, |
| 59 | + LIT_MAGIC_STRING_MAP_UL); |
| 60 | +} /* ecma_builtin_map_prototype_dispatch_routine */ |
211 | 61 | /** |
212 | 62 | * @} |
213 | 63 | * @} |
|
0 commit comments