Outsource magic error messages (#4821)

Modify tools/gen-magic-strings.py to generate error messages.

JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi repasics@inf.u-szeged.hu
This commit is contained in:
Csaba Repasi
2021-11-25 14:06:40 +01:00
committed by GitHub
parent fc4168f2b4
commit 271d9b2463
111 changed files with 1947 additions and 925 deletions
@@ -97,7 +97,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 (ecma_error_callback_is_not_callable));
return ecma_raise_type_error (ECMA_ERR_CALLBACK_IS_NOT_CALLABLE);
}
/* 3.b */
@@ -136,7 +136,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 (ecma_error_cannot_convert_to_object));
return ecma_raise_type_error (ECMA_ERR_CANNOT_CONVERT_TO_OBJECT);
}
/* 6.c */
@@ -297,7 +297,7 @@ iterator_cleanup:
if (ecma_is_value_undefined (array) || ecma_is_value_null (array))
{
ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_cannot_convert_to_object));
ecma_raise_type_error (ECMA_ERR_CANNOT_CONVERT_TO_OBJECT);
goto cleanup;
}
@@ -482,7 +482,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 (ecma_error_invalid_array_length));
return ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
return ecma_make_object_value (ecma_op_new_array_object (num_uint32));