Initializing [[FormalParameters]] internal property of Function object in ecma_op_create_function_object.
This commit is contained in:
@@ -395,7 +395,6 @@ ecma_free_internal_property (ecma_property_t *property_p) /**< the property */
|
|||||||
{
|
{
|
||||||
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection */
|
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* a collection */
|
||||||
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection */
|
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* a collection */
|
||||||
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* a collection */
|
|
||||||
{
|
{
|
||||||
TODO (/* Free collection's elements */);
|
TODO (/* Free collection's elements */);
|
||||||
JERRY_UNIMPLEMENTED();
|
JERRY_UNIMPLEMENTED();
|
||||||
@@ -404,6 +403,15 @@ ecma_free_internal_property (ecma_property_t *property_p) /**< the property */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* a strings' collection */
|
||||||
|
{
|
||||||
|
if (property_value != ECMA_NULL_POINTER)
|
||||||
|
{
|
||||||
|
ecma_free_strings_collection (ECMA_GET_POINTER(property_value));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
|
case ECMA_INTERNAL_PROPERTY_SCOPE: /* a lexical environment */
|
||||||
case ECMA_INTERNAL_PROPERTY_BINDING_OBJECT: /* an object */
|
case ECMA_INTERNAL_PROPERTY_BINDING_OBJECT: /* an object */
|
||||||
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t */
|
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t */
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma-value */
|
|||||||
* @return pointer to newly created Function object
|
* @return pointer to newly created Function object
|
||||||
*/
|
*/
|
||||||
ecma_object_t*
|
ecma_object_t*
|
||||||
ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[], /**< formal parameters list */
|
ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[], /**< formal parameters list */
|
||||||
uint32_t formal_parameters_number, /**< formal parameters list's length */
|
ecma_length_t formal_parameters_number, /**< formal parameters list's length */
|
||||||
ecma_object_t *scope_p, /**< function's scope */
|
ecma_object_t *scope_p, /**< function's scope */
|
||||||
bool is_strict, /**< 'strict' flag */
|
bool is_strict, /**< 'strict' flag */
|
||||||
opcode_counter_t first_opcode_idx) /**< index of first opcode of function's body */
|
opcode_counter_t first_opcode_idx) /**< index of first opcode of function's body */
|
||||||
@@ -137,9 +137,17 @@ ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[], /*
|
|||||||
ecma_gc_update_may_ref_younger_object_flag_by_object (f, scope_p);
|
ecma_gc_update_may_ref_younger_object_flag_by_object (f, scope_p);
|
||||||
|
|
||||||
// 10., 11.
|
// 10., 11.
|
||||||
|
ecma_property_t *formal_parameters_prop_p = ecma_create_internal_property (f,
|
||||||
|
ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS);
|
||||||
if (formal_parameters_number != 0)
|
if (formal_parameters_number != 0)
|
||||||
{
|
{
|
||||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS(formal_parameter_list_p);
|
ecma_collection_header_t *formal_parameters_collection_p = ecma_new_strings_collection (formal_parameter_list_p,
|
||||||
|
formal_parameters_number);
|
||||||
|
ECMA_SET_POINTER (formal_parameters_prop_p->u.internal_property.value, formal_parameters_collection_p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
JERRY_ASSERT (formal_parameters_prop_p->u.internal_property.value == ECMA_NULL_POINTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 12.
|
// 12.
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
extern bool ecma_op_is_callable (ecma_value_t value);
|
extern bool ecma_op_is_callable (ecma_value_t value);
|
||||||
|
|
||||||
extern ecma_object_t*
|
extern ecma_object_t*
|
||||||
ecma_op_create_function_object (const ecma_char_t* formal_parameter_list_p[],
|
ecma_op_create_function_object (ecma_string_t* formal_parameter_list_p[],
|
||||||
uint32_t formal_parameters_number,
|
ecma_length_t formal_parameters_number,
|
||||||
ecma_object_t *scope_p,
|
ecma_object_t *scope_p,
|
||||||
bool is_strict,
|
bool is_strict,
|
||||||
opcode_counter_t first_opcode_idx);
|
opcode_counter_t first_opcode_idx);
|
||||||
|
|||||||
Reference in New Issue
Block a user