Setting Function's [[Get]] method to default [[Get]] method as they're behaviours for Function objects are equivalent.

This commit is contained in:
Ruben Ayrapetyan
2014-09-22 15:49:49 +04:00
parent 94f7f710a6
commit a3ca61fe0e
3 changed files with 2 additions and 64 deletions
@@ -288,61 +288,6 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], /**< f
return f;
} /* ecma_op_create_function_object */
/**
* [[Get]] function object's operation
*
* See also:
* ECMA-262 v5, 8.6.2; ECMA-262 v5, Table 8
* ECMA-262 v5, 15.3.5.4
*
* @return completion value
* Returned value must be freed with ecma_free_completion_value
*/
ecma_completion_value_t
ecma_op_function_object_get (ecma_object_t *obj_p, /**< the function object */
ecma_string_t *property_name_p) /**< property name */
{
JERRY_ASSERT(obj_p != NULL
&& !ecma_is_lexical_environment (obj_p));
JERRY_ASSERT(property_name_p != NULL);
ecma_completion_value_t ret_value;
ecma_property_t *code_prop_p = ecma_get_internal_property (obj_p, ECMA_INTERNAL_PROPERTY_CODE);
uint32_t code_prop_value = code_prop_p->u.internal_property.value;
bool is_strict;
ecma_unpack_code_internal_property_value (code_prop_value, &is_strict);
if (!is_strict)
{
ret_value = ecma_op_general_object_get (obj_p, property_name_p);
}
else
{
ECMA_TRY_CATCH (general_get_completion,
ecma_op_general_object_get (obj_p,
property_name_p),
ret_value);
ecma_string_t *caller_magic_string_p = ecma_get_magic_string (ECMA_MAGIC_STRING_CALLER);
if (ecma_compare_ecma_strings (property_name_p, caller_magic_string_p))
{
ret_value = ecma_make_throw_obj_completion_value (ecma_new_standard_error (ECMA_ERROR_TYPE));
}
else
{
ret_value = ecma_copy_completion_value (general_get_completion);
}
ecma_deref_ecma_string (caller_magic_string_p);
ECMA_FINALIZE (general_get_completion);
}
return ret_value;
} /* ecma_op_function_object_get */
/**
* Setup variables for arguments listed in formal parameter list.
*
@@ -36,9 +36,6 @@ ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[],
bool is_strict,
opcode_counter_t first_opcode_idx);
extern ecma_completion_value_t
ecma_op_function_object_get (ecma_object_t *obj_p, ecma_string_t *property_name_p);
extern ecma_completion_value_t
ecma_op_function_call (ecma_object_t *func_obj_p,
ecma_value_t this_arg_value,
+2 -6
View File
@@ -53,6 +53,8 @@ ecma_op_object_get (ecma_object_t *obj_p, /**< the object */
case ECMA_OBJECT_TYPE_GENERAL:
case ECMA_OBJECT_TYPE_ARRAY:
case ECMA_OBJECT_TYPE_STRING:
case ECMA_OBJECT_TYPE_FUNCTION:
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
case ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION:
{
return ecma_op_general_object_get (obj_p, property_name_p);
@@ -63,12 +65,6 @@ ecma_op_object_get (ecma_object_t *obj_p, /**< the object */
return ecma_op_arguments_object_get (obj_p, property_name_p);
}
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
case ECMA_OBJECT_TYPE_FUNCTION:
{
return ecma_op_function_object_get (obj_p, property_name_p);
}
case ECMA_OBJECT_TYPE_HOST:
{
JERRY_UNIMPLEMENTED();