Cleanup toNumber and toNumeric abstract operations (#4034)

JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
This commit is contained in:
Virag Orkenyi
2020-08-27 13:32:30 +02:00
committed by GitHub
parent a6cd19fa6e
commit 777b7e9c87
22 changed files with 109 additions and 156 deletions
@@ -41,13 +41,15 @@
ecma_value_t
ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Number constructor */
{
ecma_value_t conv_to_num_completion = ecma_op_to_number (arg, ECMA_TO_NUMERIC_NO_OPTS);
ecma_number_t num;
ecma_value_t conv_to_num_completion = ecma_op_to_number (arg, &num);
if (ECMA_IS_VALUE_ERROR (conv_to_num_completion))
{
return conv_to_num_completion;
}
conv_to_num_completion = ecma_make_number_value (num);
#if ENABLED (JERRY_BUILTIN_NUMBER)
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
#else /* ENABLED (JERRY_BUILTIN_NUMBER) */