Add constant error messages (#4640)
added two new file ecma-errors.h and ecma-erros.c it contains the most used errors messages. JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
@@ -96,7 +96,7 @@ ecma_builtin_array_object_from (ecma_value_t this_arg, /**< 'this' argument */
|
||||
/* 3.a */
|
||||
if (!ecma_op_is_callable (mapfn))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_callback_is_not_callable));
|
||||
}
|
||||
|
||||
/* 3.b */
|
||||
@@ -135,7 +135,7 @@ ecma_builtin_array_object_from (ecma_value_t this_arg, /**< 'this' argument */
|
||||
if (ecma_is_value_undefined (array) || ecma_is_value_null (array))
|
||||
{
|
||||
ecma_free_value (using_iterator);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert undefined or null to object"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_cannot_convert_to_object));
|
||||
}
|
||||
|
||||
/* 6.c */
|
||||
@@ -298,7 +298,7 @@ iterator_cleanup:
|
||||
|
||||
if (ecma_is_value_undefined (array) || ecma_is_value_null (array))
|
||||
{
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert undefined or null to object"));
|
||||
ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_cannot_convert_to_object));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
|
||||
|
||||
if (num != ((ecma_number_t) num_uint32))
|
||||
{
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length"));
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
|
||||
}
|
||||
|
||||
return ecma_make_object_value (ecma_op_new_array_object (num_uint32));
|
||||
|
||||
Reference in New Issue
Block a user