@@ -173,7 +173,50 @@ static ecma_completion_value_t
173
173
ecma_builtin_object_prototype_object_has_own_property (ecma_value_t this_arg, /* *< this argument */
174
174
ecma_value_t arg) /* *< first argument */
175
175
{
176
- ECMA_BUILTIN_CP_UNIMPLEMENTED (this_arg, arg);
176
+ ecma_completion_value_t return_value = ecma_make_empty_completion_value ();
177
+
178
+ /* 1. */
179
+ ECMA_TRY_CATCH (to_string_val,
180
+ ecma_op_to_string (arg),
181
+ return_value);
182
+
183
+ /* 2. */
184
+ ECMA_TRY_CATCH (obj_val,
185
+ ecma_op_to_object (this_arg),
186
+ return_value);
187
+
188
+ ecma_string_t *property_name_string_p = ecma_get_string_from_value (to_string_val);
189
+
190
+ ecma_object_t *obj_p = ecma_get_object_from_value (obj_val);
191
+
192
+ /* 3. */
193
+ ecma_property_t *property_p = ecma_op_object_get_own_property (obj_p, property_name_string_p);
194
+
195
+ if (property_p == NULL )
196
+ {
197
+ return_value = ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
198
+ }
199
+ else if (property_p->type == ECMA_PROPERTY_NAMEDDATA)
200
+ {
201
+ ecma_value_t property_value = ecma_get_named_data_property_value (property_p);
202
+
203
+ return_value = ecma_make_simple_completion_value (!ecma_is_value_undefined (property_value)
204
+ ? ECMA_SIMPLE_VALUE_TRUE
205
+ : ECMA_SIMPLE_VALUE_FALSE);
206
+ }
207
+ else if (property_p->type == ECMA_PROPERTY_NAMEDACCESSOR)
208
+ {
209
+ ecma_object_t *property_object = ecma_get_named_accessor_property_getter (property_p);
210
+
211
+ return_value = ecma_make_simple_completion_value (property_object != NULL
212
+ ? ECMA_SIMPLE_VALUE_TRUE
213
+ : ECMA_SIMPLE_VALUE_FALSE);
214
+ }
215
+ ECMA_FINALIZE (obj_val)
216
+
217
+ ECMA_FINALIZE (to_string_val)
218
+
219
+ return return_value;
177
220
} /* ecma_builtin_object_prototype_object_has_own_property */
178
221
179
222
/* *
0 commit comments