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
@@ -198,7 +198,7 @@ ecma_builtin_object_object_set_prototype_of (ecma_value_t arg1, /**< routine's f
/* 3. */
if (!ecma_is_value_object (arg2) && !ecma_is_value_null (arg2))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Prototype is neither object nor null"));
return ecma_raise_type_error (ECMA_ERR_PROTOTYPE_IS_NEITHER_OBJECT_NOR_NULL);
}
/* 4. */
@@ -231,7 +231,7 @@ ecma_builtin_object_object_set_prototype_of (ecma_value_t arg1, /**< routine's f
if (ecma_is_value_false (status))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot set [[Prototype]]"));
return ecma_raise_type_error (ECMA_ERR_SET_PROTOTYPE);
}
JERRY_ASSERT (ecma_is_value_true (status));
@@ -295,7 +295,7 @@ ecma_builtin_object_object_set_proto (ecma_value_t arg1, /**< routine's first ar
if (ecma_is_value_false (status))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot set [[Prototype]]"));
return ecma_raise_type_error (ECMA_ERR_SET_PROTOTYPE);
}
JERRY_ASSERT (ecma_is_value_true (status));
@@ -465,7 +465,7 @@ ecma_builtin_object_object_seal (ecma_object_t *obj_p) /**< routine's argument *
#if JERRY_BUILTIN_PROXY
if (ecma_is_value_false (status))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Object cannot be sealed"));
return ecma_raise_type_error (ECMA_ERR_OBJECT_CANNOT_BE_SEALED);
}
#endif /* JERRY_BUILTIN_PROXY */
@@ -496,7 +496,7 @@ ecma_builtin_object_object_freeze (ecma_object_t *obj_p) /**< routine's argument
#if JERRY_BUILTIN_PROXY
if (ecma_is_value_false (status))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Object cannot be frozen"));
return ecma_raise_type_error (ECMA_ERR_OBJECT_CANNOT_BE_FROZEN);
}
#endif /* JERRY_BUILTIN_PROXY */
@@ -529,7 +529,7 @@ ecma_builtin_object_object_prevent_extensions (ecma_object_t *obj_p) /**< routin
if (ecma_is_value_false (status))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot set [[Extensible]] property of object"));
return ecma_raise_type_error (ECMA_ERR_SET_EXTENSIBLE_PROPERTY);
}
JERRY_ASSERT (ecma_is_value_true (status));
@@ -945,7 +945,7 @@ ecma_builtin_object_object_create (ecma_value_t arg1, /**< routine's first argum
/* 1. */
if (!ecma_is_value_object (arg1) && !ecma_is_value_null (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_object));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
}
ecma_object_t *obj_p = NULL;
@@ -1012,7 +1012,7 @@ ecma_builtin_object_object_define_property (ecma_object_t *obj_p, /**< routine's
if (ecma_is_value_false (define_own_prop_ret))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The requested property update cannot be performed"));
return ecma_raise_type_error (ECMA_ERR_THE_REQUESTED_PROPERTY_UPDATE_CANNOT_BE_PERFORMED);
}
JERRY_ASSERT (ecma_is_value_true (define_own_prop_ret));
@@ -1211,7 +1211,7 @@ ecma_builtin_object_from_entries (ecma_value_t iterator) /**< object's iterator
if (!ecma_is_value_object (result))
{
ecma_free_value (result);
ecma_raise_type_error (ECMA_ERR_MSG ("Iterator value is not an object"));
ecma_raise_type_error (ECMA_ERR_ITERATOR_VALUE_IS_NOT_AN_OBJECT);
result = ecma_op_iterator_close (original_iterator);
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (result));
goto cleanup_iterator;
@@ -1403,7 +1403,7 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
#if !JERRY_ESNEXT
if (!ecma_is_value_object (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_object));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
}
#endif /* !JERRY_ESNEXT */
@@ -1412,7 +1412,7 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
#if JERRY_ESNEXT
if (!ecma_is_value_object (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_object));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
}
#endif /* JERRY_ESNEXT */