@@ -173,7 +173,45 @@ 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
+ /* 1. ToString(arg) */
177
+ ecma_completion_value_t property_name_ret = ecma_op_to_string (arg);
178
+ if (!ecma_is_completion_value_normal (property_name_ret))
179
+ {
180
+ return property_name_ret;
181
+ }
182
+
183
+ ecma_string_t *property_name_string_p = ecma_get_string_from_completion_value (property_name_ret);
184
+
185
+ /* 2. ToObject(this) */
186
+ ecma_completion_value_t obj_this = ecma_op_to_object (this_arg);
187
+ if (!ecma_is_completion_value_normal (obj_this))
188
+ {
189
+ ecma_free_completion_value (property_name_ret);
190
+ return obj_this;
191
+ }
192
+
193
+ ecma_object_t *obj_p = ecma_get_object_from_completion_value (obj_this);
194
+
195
+ /* 3. GetOwnProperty call */
196
+ ecma_property_t *property_p = ecma_op_object_get_own_property (obj_p, property_name_string_p);
197
+
198
+ ecma_free_completion_value (property_name_ret);
199
+ ecma_free_completion_value (obj_this);
200
+
201
+ if (property_p == NULL )
202
+ {
203
+ return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
204
+ }
205
+
206
+ JERRY_ASSERT (property_p->type == ECMA_PROPERTY_NAMEDDATA);
207
+ ecma_value_t property_value = ecma_get_named_data_property_value (property_p);
208
+
209
+ if (ecma_is_value_undefined (property_value))
210
+ {
211
+ return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_FALSE);
212
+ }
213
+
214
+ return ecma_make_simple_completion_value (ECMA_SIMPLE_VALUE_TRUE);
177
215
} /* ecma_builtin_object_prototype_object_has_own_property */
178
216
179
217
/* *
0 commit comments