Fix [[HasInstance]] operation for external functions

Related issue: #736

JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
This commit is contained in:
Hanjoung Lee
2015-11-26 16:29:41 +09:00
parent fe157301a2
commit 17f7bad242
2 changed files with 41 additions and 1 deletions
@@ -833,7 +833,8 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
ecma_deref_ecma_string (prototype_magic_string_p);
}
else if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION)
else if (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION ||
ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION)
{
ret_value = ecma_make_throw_obj_completion_value (ecma_new_standard_error (ECMA_ERROR_TYPE));
}