Fix setup of argument variables in case parameter names are duplicated.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-30 01:08:27 +03:00
committed by Evgeny Gavrin
parent 134491453b
commit 0c7801b996
3 changed files with 35 additions and 5 deletions
@@ -147,7 +147,12 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
JERRY_ASSERT (param_index < formal_params_number);
JERRY_ASSERT (ecma_is_value_string (*formal_params_iterator.current_value_p));
formal_params[param_index] = ecma_get_string_from_value (*formal_params_iterator.current_value_p);
ecma_string_t *param_name_p = ecma_get_string_from_value (*formal_params_iterator.current_value_p);
/*
* Formal parameter list is stored in reversed order
*/
formal_params[formal_params_number - 1u - param_index] = param_name_p;
}
JERRY_ASSERT (param_index == formal_params_number);