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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
111 changed files with 1947 additions and 925 deletions

View File

@ -25,7 +25,7 @@ jobs:
if: ${{ always() }}
- run: $RUNNER --check-license
if: ${{ always() }}
- run: $RUNNER --check-magic-strings
- run: $RUNNER --check-strings
if: ${{ always() }}
- run: $RUNNER --check-pylint
if: ${{ always() }}

View File

@ -341,6 +341,7 @@ if(ENABLE_AMALGAM)
api/jerry-snapshot.h
debugger/debugger.h
ecma/base/ecma-alloc.h
ecma/base/ecma-error-messages.inc.h
ecma/base/ecma-errors.h
ecma/base/ecma-gc.h
ecma/base/ecma-globals.h

View File

@ -33,6 +33,23 @@
#if JERRY_SNAPSHOT_SAVE || JERRY_SNAPSHOT_EXEC
/**
* Create an error object
*
* Note:
* - returned value must be freed with jerry_release_value, when it is no longer needed
* - the error flag is set for the returned value
*
* @return value of the constructed error object
*/
static jerry_value_t
jerry_create_error_from_id (jerry_error_t error_type, /**< type of error */
ecma_error_msg_t msg) /**< ecma_error_msg id of value of 'message' property
* of constructed error object */
{
return jerry_create_error (error_type, (jerry_char_t *) ecma_get_error_utf8 (msg));
} /* jerry_create_error_from_id */
/**
* Get snapshot configuration flags.
*
@ -153,8 +170,7 @@ snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p, /**< co
if (globals_p->snapshot_buffer_write_offset > JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET)
{
globals_p->snapshot_error =
jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_maximum_snapshot_size);
globals_p->snapshot_error = jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE);
return 0;
}
@ -168,8 +184,7 @@ snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p, /**< co
#if JERRY_ESNEXT
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
{
globals_p->snapshot_error =
jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_tagged_template_literals);
globals_p->snapshot_error = jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_TAGGED_TEMPLATE_LITERALS);
return 0;
}
@ -339,8 +354,7 @@ static_snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p,
if (globals_p->snapshot_buffer_write_offset >= JERRY_SNAPSHOT_MAXIMUM_WRITE_OFFSET)
{
globals_p->snapshot_error =
jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_maximum_snapshot_size);
globals_p->snapshot_error = jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE);
return 0;
}
@ -355,7 +369,7 @@ static_snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p,
{
/* Regular expression literals are not supported. */
globals_p->snapshot_error =
jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_regular_expression_not_supported);
jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_REGULAR_EXPRESSION_NOT_SUPPORTED);
return 0;
}
@ -365,8 +379,7 @@ static_snapshot_add_compiled_code (const ecma_compiled_code_t *compiled_code_p,
compiled_code_p,
((size_t) compiled_code_p->size) << JMEM_ALIGNMENT_LOG))
{
globals_p->snapshot_error =
jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_snapshot_buffer_small);
globals_p->snapshot_error = jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_SNAPSHOT_BUFFER_SMALL);
return 0;
}
@ -753,7 +766,7 @@ jerry_generate_snapshot (jerry_value_t compiled_code, /**< parsed script or func
if ((generate_snapshot_opts & ~allowed_options) != 0)
{
return jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ecma_error_snapshot_flag_not_supported);
return jerry_create_error_from_id (JERRY_ERROR_RANGE, ECMA_ERR_SNAPSHOT_FLAG_NOT_SUPPORTED);
}
const ecma_compiled_code_t *bytecode_data_p = NULL;
@ -785,7 +798,7 @@ jerry_generate_snapshot (jerry_value_t compiled_code, /**< parsed script or func
if (JERRY_UNLIKELY (bytecode_data_p == NULL))
{
return jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) ECMA_ERR_MSG ("Unsupported compiled code"));
return jerry_create_error (JERRY_ERROR_RANGE, (const jerry_char_t *) "Unsupported compiled code");
}
snapshot_globals_t globals;
@ -835,7 +848,7 @@ jerry_generate_snapshot (jerry_value_t compiled_code, /**< parsed script or func
&literals_num))
{
JERRY_ASSERT (lit_map_p == NULL);
return jerry_create_error (JERRY_ERROR_COMMON, (const jerry_char_t *) ecma_error_cannot_allocate_memory_literals);
return jerry_create_error_from_id (JERRY_ERROR_COMMON, ECMA_ERR_CANNOT_ALLOCATE_MEMORY_LITERALS);
}
jerry_snapshot_set_offsets (buffer_p + (aligned_header_size / sizeof (uint32_t)),
@ -889,17 +902,15 @@ jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
if ((exec_snapshot_opts & ~(allowed_opts)) != 0)
{
ecma_raise_range_error (ECMA_ERR_MSG ("Unsupported snapshot exec flags are specified"));
ecma_raise_range_error (ECMA_ERR_UNSUPPORTED_SNAPSHOT_EXEC_FLAGS_ARE_SPECIFIED);
return ecma_create_error_reference_from_context ();
}
const char *const invalid_version_error_p = "Invalid snapshot version or unsupported features present";
const char *const invalid_format_error_p = "Invalid snapshot format";
const uint8_t *snapshot_data_p = (uint8_t *) snapshot_p;
if (snapshot_size <= sizeof (jerry_snapshot_header_t))
{
ecma_raise_type_error (invalid_format_error_p);
ecma_raise_type_error (ECMA_ERR_INVALID_SNAPSHOT_FORMAT);
return ecma_create_error_reference_from_context ();
}
@ -908,19 +919,19 @@ jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
if (header_p->magic != JERRY_SNAPSHOT_MAGIC || header_p->version != JERRY_SNAPSHOT_VERSION
|| !snapshot_check_global_flags (header_p->global_flags))
{
ecma_raise_type_error (invalid_version_error_p);
ecma_raise_type_error (ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES);
return ecma_create_error_reference_from_context ();
}
if (header_p->lit_table_offset > snapshot_size)
{
ecma_raise_type_error (invalid_version_error_p);
ecma_raise_type_error (ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES);
return ecma_create_error_reference_from_context ();
}
if (func_index >= header_p->number_of_funcs)
{
ecma_raise_range_error (ECMA_ERR_MSG ("Function index is higher than maximum"));
ecma_raise_range_error (ECMA_ERR_FUNCTION_INDEX_IS_HIGHER_THAN_MAXIMUM);
return ecma_create_error_reference_from_context ();
}
@ -933,13 +944,13 @@ jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
{
if (!(exec_snapshot_opts & JERRY_SNAPSHOT_EXEC_ALLOW_STATIC))
{
ecma_raise_common_error (ECMA_ERR_MSG ("Static snapshots are not enabled"));
ecma_raise_common_error (ECMA_ERR_STATIC_SNAPSHOTS_ARE_NOT_ENABLED);
return ecma_create_error_reference_from_context ();
}
if (exec_snapshot_opts & JERRY_SNAPSHOT_EXEC_COPY_DATA)
{
ecma_raise_common_error (ECMA_ERR_MSG ("Static snapshots cannot be copied into memory"));
ecma_raise_common_error (ECMA_ERR_STATIC_SNAPSHOTS_CANNOT_BE_COPIED_INTO_MEMORY);
return ecma_create_error_reference_from_context ();
}
}
@ -995,7 +1006,7 @@ jerry_exec_snapshot (const uint32_t *snapshot_p, /**< snapshot */
{
JERRY_ASSERT (script_p->refs_and_type >= CBC_SCRIPT_REF_ONE);
jmem_heap_free_block (script_p, script_size);
return ecma_raise_type_error (invalid_format_error_p);
return ecma_raise_type_error (ECMA_ERR_INVALID_SNAPSHOT_FORMAT);
}
script_p->refs_and_type -= CBC_SCRIPT_REF_ONE;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,856 @@
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* This file is automatically generated by the gen-strings.py script
* from ecma-error-messages.ini. Do not edit! */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_GROUP, "Invalid group")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ESCAPE, "Invalid escape")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_ATOMICS || JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_LENGTH, "Invalid length")
#endif /* JERRY_BUILTIN_ATOMICS \
|| JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_OFFSET, "Invalid offset")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_EXPECTED, "Object expected")
#if JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT, "Invalid argument")
#endif /* JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_NOTHING_TO_REPEAT, "Nothing to repeat")
#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_OBJECT, "Expected an object")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CAPABILITY, "Invalid capability")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT, "Invalid code point")
#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_QUANTIFIER, "Invalid quantifier")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_NO_SOURCE_ARGUMENT, "No source argument")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_UNTERMINATED_GROUP, "Unterminated group")
#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_FUNCTION, "Expected a function")
#if JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_INVALID_JSON_FORMAT, "Invalid JSON format")
#endif /* JERRY_BUILTIN_JSON */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UTF8_STRING, "Invalid UTF8 string")
#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_COUNT_VALUE, "Invalid count value")
#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
#if !(JERRY_BUILTIN_REALMS)
ECMA_ERROR_DEF (ECMA_ERR_REALMS_ARE_DISABLED, "Realms are disabled")
#endif /* !(JERRY_BUILTIN_REALMS) */
ECMA_ERROR_DEF (ECMA_ERR_UNDEFINED_REFERENCE, "Undefined reference")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARRAY_LENGTH, "Invalid Array length")
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INVALID_REGEXP_FLAGS, "Invalid RegExp flags")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_JSON_STRINGIFY_ERROR, "JSON stringify error")
#endif /* JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_STACK_LIMIT_EXCEEDED, "Stack limit exceeded")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_WEAKREF
ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_OBJECT, "Target is not Object")
#endif /* JERRY_BUILTIN_WEAKREF */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_VALUE_EXCPECTED, "BigInt value expected")
#endif /* JERRY_BUILTIN_BIGINT */
ECMA_ERROR_DEF (ECMA_ERR_BINDING_CANNOT_SET, "Binding cannot be set")
#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_STRING_, "Invalid string length")
#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_KEY_MUST_BE_AN_OBJECT, "Key must be an object")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_MISSING_ARRAY_ELEMENT, "Missing Array element")
#endif /* JERRY_BUILTIN_ARRAY */
#if JERRY_BUILTIN_WEAKREF
ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_WEAKREF, "Target is not weakRef")
#endif /* JERRY_BUILTIN_WEAKREF */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE, "Target not extensible")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB
ECMA_ERROR_DEF (ECMA_ERR_GETTER_IS_NOT_CALLABLE, "Getter is not callable")
#endif /* JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_HANDLER_CANNOT_BE_NULL, "Handler cannot be null")
#endif /* JERRY_BUILTIN_PROXY */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UTF8_CHARACTER, "Invalid UTF8 character")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UTF8_CODEPOINT, "Invalid UTF8 codepoint")
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CONTAINER_TYPE, "Invalid container type")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_RANGE_OF_INDEX, "Invalid range of index")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if !(JERRY_BUILTIN_PROXY)
ECMA_ERROR_DEF (ECMA_ERR_PROXY_IS_NOT_SUPPORTED, "Proxy is not supported")
#endif /* !(JERRY_BUILTIN_PROXY) */
#if !(JERRY_BUILTIN_REALMS)
ECMA_ERROR_DEF (ECMA_ERR_REALM_IS_NOT_AVAILABLE, "Realm is not available")
#endif /* !(JERRY_BUILTIN_REALMS) */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_ZERO_DIVISION, "BigInt division by zero")
#endif /* JERRY_BUILTIN_BIGINT */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_AN_ARRAYBUFFER, "Expected an ArrayBuffer")
#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CHARACTER_CLASS, "Invalid character class")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ESCAPE_SEQUENCE, "Invalid escape sequence")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_FORMAT, "Invalid snapshot format")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_JSON_STRING_PARSE_ERROR, "JSON string parse error")
#endif /* JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_LONE_QUANTIFIER_BRACKET, "Lone quantifier bracket")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_FROZEN, "Object cannot be frozen")
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_CANNOT_BE_SEALED, "Object cannot be sealed")
#endif /* JERRY_BUILTIN_PROXY */
#if !(JERRY_BUILTIN_REGEXP)
ECMA_ERROR_DEF (ECMA_ERR_REGEXP_IS_NOT_SUPPORTED, "RegExp is not supported")
#endif /* !(JERRY_BUILTIN_REGEXP) */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_UNMATCHED_CLOSE_BRACKET, "Unmatched close bracket")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_NOT_MODULE, "Argument is not a module")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SET_PROTOTYPE, "Cannot set [[Prototype]]")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_NEW_ARRAY_LENGTH, "Invalid new Array length")
#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_CALLABLE, "Iterator is not callable")
#endif /* JERRY_ESNEXT */
#if !(JERRY_BUILTIN_JSON)
ECMA_ERROR_DEF (ECMA_ERR_JSON_NOT_SUPPORTED, "JSON support is disabled")
#endif /* !(JERRY_BUILTIN_JSON) */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_IS_IN_ERROR_STATE, "Module is in error state")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_REJECT_MUST_BE_UNDEFINED, "Reject must be undefined")
#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_REQUEST_IS_NOT_AVAILABLE, "Request is not available")
#endif /* JERRY_MODULE_SYSTEM */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT, "Argument is not an object")
#if JERRY_BUILTIN_ATOMICS
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_SUPPORTED, "Argument is not supported")
#endif /* JERRY_BUILTIN_ATOMICS */
#if JERRY_BUILTIN_STRING && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CODE_POINT_ERROR, "Error: Invalid code point")
#endif /* JERRY_BUILTIN_STRING && JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPEDARRAY_LENGTH, "Invalid TypedArray length")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEXADECIMAL_VALUE, "Invalid hexadecimal value")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_IS_NOT_AN_OBJECT, "Iterator is not an object")
ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED, "Resolve must be undefined")
#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_BUFFER_SMALL, "Snapshot buffer too small")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_THE_STRUCTURE_IS_CYCLICAL, "The structure is cyclical")
#endif /* JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_UNEXPECTED_END_OF_PATTERN, "Unexpected end of pattern")
#endif /* JERRY_BUILTIN_REGEXP */
#if !(JERRY_BUILTIN_BIGINT)
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_NOT_SUPPORTED, "BigInt support is disabled")
#endif /* !(JERRY_BUILTIN_BIGINT) */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_DATAVIEW_OBJECT, "Expected a DataView object")
#endif /* JERRY_BUILTIN_DATAVIEW */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_FUNCTION_OBJECT, "Expected a function object")
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARRAYBUFFER_LENGTH, "Invalid ArrayBuffer length")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if !(JERRY_MODULE_SYSTEM)
ECMA_ERROR_DEF (ECMA_ERR_MODULE_NOT_SUPPORTED, "Module support is disabled")
#endif /* !(JERRY_MODULE_SYSTEM) */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_OBJECT_IS_NOT_A_TYPEDARRAY, "Object is not a TypedArray")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_RECEIVER_MUST_BE_AN_OBJECT, "Receiver must be an object")
#endif /* JERRY_ESNEXT */
#if !(JERRY_ESNEXT)
ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_NOT_SUPPORTED, "Symbol support is disabled")
#endif /* !(JERRY_ESNEXT) */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_SERIALIZED, "BigInt cannot be serialized")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_JSON */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_AN_OBJECT, "Container is not an object.")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE, "Invalid hex escape sequence")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SPECIES_CONSTRUCTOR, "Invalid species constructor")
#endif /* JERRY_ESNEXT */
#if !(JERRY_ESNEXT)
ECMA_ERROR_DEF (ECMA_ERR_PROMISE_NOT_SUPPORTED, "Promise support is disabled")
#endif /* !(JERRY_ESNEXT) */
#if JERRY_BUILTIN_PROXY || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH, "Proxy trap returned falsish")
#endif /* JERRY_BUILTIN_PROXY \
|| JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_MIN_GREATER_THAN_MAX, "Quantifier error: min > max")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SYMBOL_IS_NOT_A_CONSTRUCTOR, "Symbol is not a constructor")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_REFLECT
ECMA_ERROR_DEF (ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR, "Target is not a constructor")
#endif /* JERRY_BUILTIN_REFLECT */
ECMA_ERROR_DEF (ECMA_ERR_ACCESSOR_WRITABLE, "Accessors cannot be writable")
#if !(JERRY_BUILTIN_DATAVIEW)
ECMA_ERROR_DEF (ECMA_ERR_DATA_VIEW_NOT_SUPPORTED, "DataView support is disabled")
#endif /* !(JERRY_BUILTIN_DATAVIEW) */
#if JERRY_BUILTIN_DATE
ECMA_ERROR_DEF (ECMA_ERR_DATE_MUST_BE_A_FINITE_NUMBER, "Date must be a finite number")
#endif /* JERRY_BUILTIN_DATE */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_LOCAL_VARIABLE_IS_REDECLARED, "Local variable is redeclared")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_BINARY_OPERATION, "Unsupported binary operation")
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_UNTERMINATED_CHARACTER_CLASS, "Unterminated character class")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_DATAVIEW || JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARRAYBUFFER_IS_DETACHED, "ArrayBuffer has been detached")
#endif /* JERRY_BUILTIN_DATAVIEW \
|| JERRY_BUILTIN_TYPEDARRAY \
|| JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_NOT_AN_OBJECT, "Constructor must be an object")
#endif /* JERRY_ESNEXT */
#if !(JERRY_BUILTIN_CONTAINER)
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_NOT_SUPPORTED, "Container support is disabled")
#endif /* !(JERRY_BUILTIN_CONTAINER) */
#if JERRY_BUILTIN_REALMS
ECMA_ERROR_DEF (ECMA_ERR_FIRST_ARGUMENT_IS_NOT_A_REALM, "First argument is not a realm")
#endif /* JERRY_BUILTIN_REALMS */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INCOMPATIBLE_TYPEDARRAY_TYPES, "Incompatible TypedArray types")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_FOR_TYPEDARRAY, "Incorrect type for TypedArray")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_OR_OUT_OF_RANGE_INDEX, "Invalid or out-of-range index")
#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE, "Maximum snapshot size reached")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_CANNOT_BE_INSTANTIATED, "Module cannot be instantiated")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SPECIES_MUST_BE_A_CONSTRUCTOR, "Species must be a constructor")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_A_PROXY, "Argument is not a Proxy object")
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_ARRAY_BUFFER, "Argument is not an ArrayBuffer")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_MAP_REQUIRES_NEW, "Constructor Map requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_SET_REQUIRES_NEW, "Constructor Set requires 'new'")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_LINKED_STATE, "Module must be in linked state")
ECMA_ERROR_DEF (ECMA_ERR_UNKNOWN_EXPORT, "Native module export not found")
#endif /* JERRY_MODULE_SYSTEM */
ECMA_ERROR_DEF (ECMA_ERR_PASSED_ARGUMENT_IS_NOT_A_REALM, "Passed argument is not a realm")
#if JERRY_BUILTIN_BIGINT || JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_RADIX_IS_OUT_OF_RANGE, "Radix must be between 2 and 36")
#endif /* JERRY_BUILTIN_BIGINT \
|| JERRY_BUILTIN_NUMBER */
#if !(JERRY_BUILTIN_TYPEDARRAY)
ECMA_ERROR_DEF (ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED, "TypedArray support is disabled")
#endif /* !(JERRY_BUILTIN_TYPEDARRAY) */
ECMA_ERROR_DEF (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING, "Unicode surrogate pair missing")
#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE, "Invalid control escape sequence")
ECMA_ERROR_DEF (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE, "Invalid unicode escape sequence")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_NEXT_IS_NOT_CALLABLE, "Iterator 'next' is not callable")
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_VALUE_IS_NOT_AN_OBJECT, "Iterator value is not an object")
ECMA_ERROR_DEF (ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE, "Resolve method must be callable")
#endif /* JERRY_ESNEXT */
#if !(JERRY_PARSER)
ECMA_ERROR_DEF (ECMA_ERR_PARSER_NOT_SUPPORTED, "Source code parsing is disabled")
#endif /* !(JERRY_PARSER) */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_MUST_RETURN_WITH_AN_OBJECT, "Trap must return with an object")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_CONTAINER_OPERATION, "Unsupported container operation")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_METHOD_RETURN_IS_NOT_CALLABLE, "method 'return' is not callable")
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_PROMISE, "Argument 'this' is not a Promise")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT, "Argument 'this' is not an object")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL, "Argument 'this' must be a Symbol")
#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_CALLBACK_RESULT_NOT_MODULE, "Callback result must be a module")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_REQUIRES_NEW, "Class constructor requires 'new'")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE, "Compare function is not callable")
#endif /* JERRY_BUILTIN_ARRAY */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROXY_REQUIRES_NEW, "Constructor Proxy requires 'new'")
#endif /* JERRY_BUILTIN_PROXY */
ECMA_ERROR_DEF (ECMA_ERR_EXPECTED_A_CONFIGURABLE_PROPERTY, "Expected a configurable property")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_FIRST_PARAMETER_MUST_BE_CALLABLE, "First parameter must be callable")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_ADD_ORSET_IS_NOT_CALLABLE, "Function add/set is not callable")
#endif /* JERRY_BUILTIN_CONTAINER && JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT, "Iterator result is not an object")
#endif /* JERRY_ESNEXT */
#if (JERRY_STACK_LIMIT != 0)
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_CALL_STACK_SIZE_EXCEEDED, "Maximum call stack size exceeded")
#endif /* (JERRY_STACK_LIMIT != 0) */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_STRING_LENGTH_IS_REACHED, "Maximum string length is reached")
#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_MUST_BE_IN_UNLINKED_STATE, "Module must be in unlinked state")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_STATIC_SNAPSHOTS_ARE_NOT_ENABLED, "Static snapshots are not enabled")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_BUILTIN_WEAKREF
ECMA_ERROR_DEF (ECMA_ERR_WEAKREF_TARGET_MUST_BE_AN_OBJECT, "WeakRef target must be an object")
#endif /* JERRY_BUILTIN_WEAKREF */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION, "Argument 'this' is not a function")
#if JERRY_BUILTIN_ATOMICS
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_NOT_SHARED_ARRAY_BUFFER, "Argument is not SharedArrayBuffer")
#endif /* JERRY_BUILTIN_ATOMICS */
#if JERRY_BUILTIN_ARRAY || JERRY_BUILTIN_CONTAINER || JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CALLBACK_IS_NOT_CALLABLE, "Callback function is not callable")
#endif /* JERRY_BUILTIN_ARRAY \
|| JERRY_BUILTIN_CONTAINER \
|| JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_INITIAL_VALUE_CANNOT_BE_UNDEFINED, "Initial value cannot be undefined")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_INPUT_MUST_BE_A_VALID_UTF8_STRING, "Input must be a valid utf8 string")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SHARED_ARRAYBUFFER_LENGTH, "Invalid Shared ArrayBuffer length")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
ECMA_ERROR_DEF (ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL, "Invalid type for constructor call")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE, "Iterator 'throw' is not available")
#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_NAMESPACE_OBJECT_IS_NOT_AVAILABLE, "Namespace object is not available")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_PROXY_TARGET_IS_NOT_A_CONSTRUCTOR, "Proxy target is not a constructor")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_REALMS
ECMA_ERROR_DEF (ECMA_ERR_SECOND_ARGUMENT_MUST_BE_AN_OBJECT, "Second argument must be an object")
#endif /* JERRY_BUILTIN_REALMS */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_BUFFER_NOT_OBJECT, "Argument 'buffer' is not an object")
#endif /* JERRY_BUILTIN_DATAVIEW */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR, "Argument 'this' is not an iterator")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_VALUE_MSG, "Argument cannot be marked as error")
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_PROMISE_REQUIRES_NEW, "Constructor Promise requires 'new'")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKMAP_REQUIRES_NEW, "Constructor WeakMap requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKSET_REQUIRES_NEW, "Constructor WeakSet requires 'new'")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_DEBUGGER
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SCOPE_CHAIN_INDEX_FOR_EVAL, "Invalid scope chain index for eval")
#endif /* JERRY_DEBUGGER */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_MAXIMUM_TYPEDARRAY_SIZE_IS_REACHED, "Maximum TypedArray size is reached")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_THE_GIVEN_ARGUMENT_IS_NOT_A_SYMBOL, "The given argument is not a Symbol")
ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_REJECT_MUST_BE_CALLABLE, "'reject' parameter must be callable")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY, "Argument 'this' is not a TypedArray")
#endif /* JERRY_BUILTIN_TYPEDARRAY \
|| JERRY_ESNEXT */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_ALLOCATE_MEMORY_LITERALS, "Cannot allocate memory for literals")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVOKE_NULLABLE_SUPER_METHOD, "Cannot invoke nullable super method")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_DATAVIEW_REQUIRES_NEW, "Constructor DataView requires 'new'")
#endif /* JERRY_BUILTIN_DATAVIEW */
#if JERRY_BUILTIN_WEAKREF
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_WEAKREF_REQUIRES_NEW, "Constructor WeakRef requires 'new'.")
#endif /* JERRY_BUILTIN_WEAKREF */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SUPER_BINDING_MUST_BE_A_CONSTRUCTOR, "Super binding must be a constructor")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_VALUE_CANNOT_BE_CONVERTED_TO_BIGINT, "Value cannot be converted to BigInt")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PARAMETER_RESOLVE_MUST_BE_CALLABLE, "'resolve' parameter must be callable")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_DATE || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT, "Argument 'this' is not a Date object")
#endif /* JERRY_BUILTIN_DATE \
|| JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR, "Argument 'this' is not a constructor")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_BIGINT_FUNCTION_NOT_CONSTRUCTOR, "BigInt function is not a constructor")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTED_OBJECT_IS_NOT_TYPEDARRAY, "Constructed object is not TypedArray")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_INT8_ARRAY_REQUIRES_NEW, "Constructor Int8Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_IS_NOT_A_CONTAINER_OBJECT, "Container is not a container object.")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_DATE && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE, "Invalid argument type in toPrimitive")
#endif /* JERRY_BUILTIN_DATE && JERRY_ESNEXT */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_METHODS_INVOKE_WITH_NEW, "Methods cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_STRING_VALUES, "Module exports must be string values")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_REFLECT || JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_IS_NEITHER_OBJECT_NOR_NULL, "Prototype is neither object nor null")
#endif /* JERRY_BUILTIN_REFLECT \
|| JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_THE_MAPFN_ARGUMENT_IS_NOT_CALLABLE, "The 'mapfn' argument is not callable")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_THE_TWO_DESCRIPTORS_ARE_INCOMPATIBLE, "The two descriptors are incompatible")
#endif /* JERRY_BUILTIN_PROXY */
ECMA_ERROR_DEF (ECMA_ERR_WRONG_ARGS_MSG, "This type of argument is not allowed")
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_CONTAINER_NEEDED, "Value is not a Container or Iterator")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP, "Argument 'this' is not a valid RegExp")
#endif /* JERRY_BUILTIN_REGEXP */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARRAY_BUFFER_DETACHED, "ArrayBuffer has already been detached")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
ECMA_ERROR_DEF (ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR, "Built-in routines have no constructor")
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_INT16_ARRAY_REQUIRES_NEW, "Constructor Int16Array requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_INT32_ARRAY_REQUIRES_NEW, "Constructor Int32Array requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT8_ARRAY_REQUIRES_NEW, "Constructor Uint8Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_INDEX_IS_HIGHER_THAN_MAXIMUM, "Function index is higher than maximum")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_BUILTIN_REGEXP
ECMA_ERROR_DEF (ECMA_ERR_RANGE_OUT_OF_ORDER_IN_CHARACTER_CLASS, "Range out of order in character class")
#endif /* JERRY_BUILTIN_REGEXP */
ECMA_ERROR_DEF (ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID, "Result of [[DefaultValue]] is invalid")
ECMA_ERROR_DEF (ECMA_ERR_RIGHT_VALUE_OF_IN_MUST_BE_AN_OBJECT, "Right value of 'in' must be an object")
#if !(JERRY_BUILTIN_SHAREDARRAYBUFFER)
ECMA_ERROR_DEF (ECMA_ERR_SHARED_ARRAYBUFFER_NOT_SUPPORTED, "SharedArrayBuffer support is disabled")
#endif /* !(JERRY_BUILTIN_SHAREDARRAYBUFFER) */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RETURNED_NEITHER_OBJECT_NOR_NULL, "Trap returned neither object nor null")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_WITH_DUPLICATED_ENTRIES, "Trap returned with duplicated entries")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_UNARY_PLUS_IS_NOT_ALLOWED_FOR_BIGINTS, "Unary plus is not allowed for BigInts")
#endif /* JERRY_BUILTIN_BIGINT */
#if !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP || JERRY_BUILTIN_REGEXP && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP, "Argument 'this' is not a RegExp object")
#endif /* !JERRY_ESNEXT && JERRY_BUILTIN_ANNEXB && JERRY_BUILTIN_REGEXP \
|| JERRY_BUILTIN_REGEXP && JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_ARRAY_BUFFER, "Cannot allocate memory for ArrayBuffer")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED, "Constant bindings cannot be reassigned")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_ARRAYBUFFER_REQUIRES_NEW, "Constructor ArrayBuffer requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT16_ARRAY_REQUIRES_NEW, "Constructor Uint16Array requires 'new'")
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT32_ARRAY_REQUIRES_NEW, "Constructor Uint32Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_IS_CURRENTLY_UNDER_EXECUTION, "Generator is currently under execution")
ECMA_ERROR_DEF (ECMA_ERR_ITERATOR_RETURN_RESULT_IS_NOT_OBJECT, "Iterator 'return' result is not object")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED, "Returned ArrayBuffer has been detached")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP, "Search string can't be of type: RegExp")
ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT, "Value received by yield* is not object")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BOOLEAN
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT, "Argument 'this' is not a Boolean object")
#endif /* JERRY_BUILTIN_BOOLEAN */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW, "Constructor Float32Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_FLOAT64_ARRAY_REQUIRES_NEW, "Constructor Float64Array requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY && JERRY_NUMBER_TYPE_FLOAT64 */
ECMA_ERROR_DEF (ECMA_ERR_FUNCTION_PROTOTYPE_NOT_A_CONSTRUCTOR, "Function.prototype is not a constructor")
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE, "Imported binding shadows local variable")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID, "Prototype from revoked Proxy is invalid")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG, "RegExp argument should have global flag")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_BUILTIN_STRING && JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_IS_NEITHER_AN_OBJECT_NOR_UNDEFINED, "Trap is neither an object nor undefined")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROMISE_RESOLVE_ITSELF, "A promise cannot be resolved with itself")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIGINT64_ARRAY_REQUIRES_NEW, "Constructor BigInt64Array requires 'new'")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_MODULE_EXPORTS_MUST_BE_VALID_IDENTIFIERS, "Module exports must be valid identifiers")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_GENERATOR_OBJECT, "Argument 'this' is not a generator object")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT, "Argument cannot be converted to an object")
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_BIGINT_VALUE, "Cannot allocate memory for a BigInt value")
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_BIGINT_TO_NUMBER, "Cannot convert a BigInt value to a number")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER, "Cannot convert a Symbol value to a number")
ECMA_ERROR_DEF (ECMA_ERR_CONVERT_SYMBOL_TO_STRING, "Cannot convert a Symbol value to a string")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_BIG_UINT64_ARRAY_REQUIRES_NEW, "Constructor BigUInt64Array requires 'new'")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE, "Fraction digits must be between 0 and 100")
#endif /* JERRY_BUILTIN_NUMBER */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT, "Return value is not an ArrayBuffer object")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SUPER_CONSTRUCTOR_MAY_ONLY_BE_CALLED_ONCE, "Super constructor may only be called once")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_BINDING_NOT_EXIST_OR_UNINITIALIZED, "Binding does not exist or is uninitialised")
#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CONVERT_TO_OBJECT, "Cannot convert undefined or null to object")
#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
#if JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_PRECISION_DIGITS_MUST_BE_BETWEEN_IN_RANGE, "Precision digits must be between 1 and 100")
#endif /* JERRY_BUILTIN_NUMBER */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_NAME_IS_NEITHER_SYMBOL_NOR_STRING, "Property name is neither Symbol nor string")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_STRING_CANNOT_BE_CONVERTED_TO_BIGINT_VALUE, "String cannot be converted to BigInt value")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_BUILTIN_CONTAINER
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_TYPE_CALL, "Operator called on incorrect container type")
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_BUILTIN_ARRAY
ECMA_ERROR_DEF (ECMA_ERR_REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE, "Reduce of empty Array with no initial value")
#endif /* JERRY_BUILTIN_ARRAY */
#if JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT)
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP_OBJECT, "Argument 'this' is not a valid RegExp object")
#endif /* JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT, "Argument 'this' is not an ArrayBuffer object")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Arrow functions cannot be invoked with 'new'")
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_FUNCTIONS_INVOKE_WITH_NEW, "Async functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_SET_EXTENSIBLE_PROPERTY, "Cannot set [[Extensible]] property of object")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_SHAREDARRAYBUFFER_REQUIRES_NEW, "Constructor SharedArrayBuffer requires 'new'")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONSTRUCTOR_UINT8_CLAMPED_ARRAY_REQUIRES_NEW, "Constructor Uint8ClampedArray requires 'new'")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_BIGINT && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_NEGATIVE_EXPONENT_IS_NOT_ALLOWED_FOR_BIGINTS, "Negative exponent is not allowed for BigInts")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_ESNEXT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PROMISE_ALL_REMAINING_ELEMENTS_LIMIT_REACHED, "Promise.all remaining elements limit reached")
ECMA_ERROR_DEF (ECMA_ERR_VALUE_RECEIVED_BY_FOR_ASYNC_OF_IS_NOT_OBJECT, "Value received by for-async-of is not object")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_INFINITY_OR_NAN_CANNOT_BE_CONVERTED_TO_BIGINT, "Infinity or NaN cannot be converted to BigInt")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT)
ECMA_ERROR_DEF (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION, "Invalid argument is passed to RegExp function")
#endif /* JERRY_BUILTIN_REGEXP && !(JERRY_ESNEXT) */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_OPERATOR_DELETE_RETURNED_FALSE_IN_STRICT_MODE, "Operator delete returned false in strict mode")
ECMA_ERROR_DEF (ECMA_ERR_PROPERTY_PROTOTYPE_IS_NOT_AN_OBJECT, "Property 'prototype' is not an object or null")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_PROXY_HANDLER_IS_NULL_FOR_ISARRAY_OPERATION, "Proxy handler is null for 'isArray' operation")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_REGULAR_EXPRESSION_NOT_SUPPORTED, "Regular expression literals are not supported")
#endif /* JERRY_SNAPSHOT_SAVE */
ECMA_ERROR_DEF (ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT, "Right value of 'instanceof' must be an object")
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_STATIC_SNAPSHOTS_CANNOT_BE_COPIED_INTO_MEMORY, "Static snapshots cannot be copied into memory")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_TAGGED_TEMPLATE_LITERALS, "Unsupported feature: tagged template literals")
#endif /* JERRY_ESNEXT && JERRY_SNAPSHOT_SAVE */
#if JERRY_SNAPSHOT_SAVE
ECMA_ERROR_DEF (ECMA_ERR_SNAPSHOT_FLAG_NOT_SUPPORTED, "Unsupported generate snapshot flags specified")
#endif /* JERRY_SNAPSHOT_SAVE */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_UNSUPPORTED_SNAPSHOT_EXEC_FLAGS_ARE_SPECIFIED, "Unsupported snapshot exec flags are specified")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_VALUE_FOR_CLASS_HERITAGE_IS_NOT_A_CONSTRUCTOR, "Value for class heritage is not a constructor")
#endif /* JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_TOO_MANY_ARGUMENTS_DECLARED_FOR_FUNCTION_APPLY,
"Too many arguments declared for Function.apply")
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ACCESSOR_FUNCTIONS_INVOKE_WITH_NEW, "Accessor functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_LINK_TO_MODULE_IN_ERROR_STATE, "Cannot link to a module which is in error state")
#endif /* JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_ONLY_INTEGER_NUMBERS_CAN_BE_CONVERTED_TO_BIGINT,
"Only integer numbers can be converted to BigInt")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_TYPEDARRAY_INTRINSTIC_DIRECTLY_CALLED, "TypedArray intrinstic cannot be directly called")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_UNSIGNED_RIGHT_SHIFT_IS_NOT_ALLOWED_FOR_BIGINTS,
"Unsigned right shift is not allowed for BigInts")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_ASYNC_GENERATOR, "Argument 'this' is not an async generator object")
ECMA_ERROR_DEF (ECMA_ERR_CLASS_EXTENDS_NOT_CONSTRUCTOR, "Class extends value is not a constructor or null")
#endif /* JERRY_ESNEXT */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW, "Generator functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_BUILTIN_REGEXP && JERRY_ESNEXT || JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT)
ECMA_ERROR_DEF (ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL,
"Return value of 'exec' must be an object or null")
#endif /* JERRY_BUILTIN_REGEXP && JERRY_ESNEXT \
|| JERRY_BUILTIN_REGEXP && !(!JERRY_ESNEXT) */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER,
"Start offset is outside the bounds of the buffer")
#endif /* JERRY_BUILTIN_DATAVIEW */
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER, "Argument 'this' is not a SharedArrayBuffer object")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_CONSTRUCTOR_NEW, "Class constructor cannot be invoked without 'new'")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_GET_TRAP, "Incorrect value is returned by a Proxy 'get' trap")
ECMA_ERROR_DEF (ECMA_ERR_INCORRECT_RETURN_PROXY_SET_TRAP, "Incorrect value is returned by a Proxy 'set' trap")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CLASS_IS_NON_CONFIGURABLE, "Prototype property of a class is non-configurable")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_PUSHING_TOO_HIGH_ELEMENT, "Pushing element over 2**53-1 length is disallowed")
#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
ECMA_ERROR_DEF (ECMA_ERR_THE_REQUESTED_PROPERTY_UPDATE_CANNOT_BE_PERFORMED,
"The requested property update cannot be performed")
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_CONFIGURABLE_KEYS,
"Trap result did not include all configurable keys")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_TARGET_NOT_EXTENSIBLE, "Trap returned truish for target is not extensible")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_NUMBER
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_NUMBER, "Argument 'this' is not a number or a Number object")
#endif /* JERRY_BUILTIN_NUMBER */
#if JERRY_BUILTIN_STRING
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_STRING_OBJECT, "Argument 'this' is not a string or a String object")
#endif /* JERRY_BUILTIN_STRING */
#if JERRY_BUILTIN_SHAREDARRAYBUFFER
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER_OBJECT,
"Argument 'this' is not an SharedArrayBuffer object")
#endif /* JERRY_BUILTIN_SHAREDARRAYBUFFER */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_ARROW_FUNCTIONS_INVOKE_WITH_NEW, "Async arrow functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_BUILTIN_ARRAY && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_UNSHIFT_TOO_HIGH, "Unshift elements over 2**53-1 length is disallowed")
#endif /* JERRY_BUILTIN_ARRAY && JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_NON_CONFIGURABLE_KEYS,
"Trap result did not include all non-configurable keys")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_ASYNC_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW,
"Async generator functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_BUILTIN_REFLECT
ECMA_ERROR_DEF (ECMA_ERR_REFLECT_EXPECTS_AN_OBJECT_AS_SECOND_ARGUMENT,
"Reflect.construct expects an object as second argument")
#endif /* JERRY_BUILTIN_REFLECT */
#if JERRY_ERROR_MESSAGES && JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_SCRIPT_GLOBAL_FUNCTIONS_INVOKE_WITH_NEW,
"Script (global) functions cannot be invoked with 'new'")
#endif /* JERRY_ERROR_MESSAGES && JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_CREATE_PROXY, "Cannot create Proxy with a non-object target or handler")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_DERIVED_CTOR_RETURN_NOR_OBJECT_OR_UNDEFINED,
"Derived constructors may only return object or undefined")
#endif /* JERRY_ESNEXT */
#if JERRY_SNAPSHOT_EXEC
ECMA_ERROR_DEF (ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES,
"Invalid snapshot version or unsupported features present")
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_TYPEDARRAY_SMALLER_THAN_FILTER_CALL_RESULT,
"Constructed TypedArray is smaller than filter call result")
ECMA_ERROR_DEF (ECMA_ERR_DERIVED_ARRAY_BUFFER_CTOR_BUFFER_TOO_SMALL,
"Derived ArrayBuffer constructor created a too small buffer")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_EXTENSIBILITY,
"Trap result does not reflect extensibility of Proxy target")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_EXTRA_KEYS_FOR_A_NON_EXTENSIBLE_TARGET,
"Trap returned extra keys for a non-extensible Proxy target")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_ARRAY_BUFFER_RETURNED_THIS_FROM_CONSTRUCTOR,
"ArrayBuffer subclass returned this from species constructor")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_DATAVIEW
ECMA_ERROR_DEF (ECMA_ERR_ARGUMENT_BUFFER_NOT_ARRAY_OR_SHARED_BUFFER,
"Argument 'buffer' is not an ArrayBuffer or SharedArrayBuffer")
#endif /* JERRY_BUILTIN_DATAVIEW */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_INEXTENSIBILITY,
"Trap result does not reflect inextensibility of Proxy target")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_TYPEDARRAY_INTRINSTIC_CALLED_BY_NEW_EXPRESSION,
"TypedArray intrinstic cannot be called by a 'new' expression")
#endif /* JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY
ECMA_ERROR_DEF (ECMA_ERR_CONTENTTYPE_RETURNED_TYPEDARRAY_NOT_MATCH_SOURCE,
"TypedArray returned by [[ContentType]] does not match source")
#endif /* JERRY_BUILTIN_BIGINT && JERRY_BUILTIN_TYPEDARRAY */
#if JERRY_BUILTIN_BIGINT
ECMA_ERROR_DEF (ECMA_ERR_ALLOCATE_BIGINT_STRING, "Cannot allocate memory for a string representation of a BigInt value")
#endif /* JERRY_BUILTIN_BIGINT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_DIFFERENT_PROTOTYPE_RETURNED,
"Target object is non-extensible and trap returned different prototype")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_ADDING_PROPERTY_NON_EXTENSIBLE_TARGET,
"Trap returned truish for adding property to the non-extensible target")
ECMA_ERROR_DEF (ECMA_ERR_GIVEN_PROPERTY_IS_A_NON_CONFIGURABLE,
"Given property is a non-configurable data property on the proxy target")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_TARGET_NOT_EXTENSIBLE,
"Trap returned falsish for property but the proxy target is not extensible")
ECMA_ERROR_DEF (ECMA_ERR_PROXY_PROPERTY_NOT_CONFIGURABLE_NOT_HAVE_GETTER,
"Property of a Proxy is non-configurable and does not have a getter function")
ECMA_ERROR_DEF (ECMA_ERR_TARGET_PROPERTY_CONFIGURE_ACCESSOR_WITHOUT_SETTER,
"The property of a Proxy target is a non configurable accessor without a setter")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT || JERRY_MODULE_SYSTEM
ECMA_ERROR_DEF (ECMA_ERR_LET_CONST_NOT_INITIALIZED,
"Variables declared by let/const must be initialized before reading their value")
#endif /* JERRY_ESNEXT \
|| JERRY_MODULE_SYSTEM */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_PROPERTY_NON_CONFIGURABLE,
"Trap returned truish for property which is non-configurable in the proxy target")
ECMA_ERROR_DEF (ECMA_ERR_TARGET_NOT_EXTENSIBLE_NOT_RETURNED_ITS_PROTOTYPE,
"Proxy target is non-extensible, but the trap did not return its actual prototype")
ECMA_ERROR_DEF (ECMA_ERR_TRAP_FALSISH_PROPERTY_NON_CONFIGURABLE,
"Trap returned falsish for property which exists in the proxy target as non-configurable")
#endif /* JERRY_BUILTIN_PROXY */
#if JERRY_ESNEXT
ECMA_ERROR_DEF (ECMA_ERR_CALL_SUPER_CONSTRUCTOR_DERIVED_CLASS_BEFORE_THIS,
"Must call super constructor in derived class before accessing 'this' or returning from it")
#endif /* JERRY_ESNEXT */
#if JERRY_BUILTIN_PROXY
ECMA_ERROR_DEF (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY,
"Trap returned truish for defining non-configurable property which is non-existent in the target")
ECMA_ERROR_DEF (
ECMA_ERR_TRAP_TRUISH_ADD_PROPERTY_INCOMPATIBLE_OTHER_PROP,
"Trap returned truish for adding property that is incompatible with the existing property in the target")
#endif /* JERRY_BUILTIN_PROXY */
ECMA_ERROR_DEF (ECMA_ERR_CANNOT_ACCESS_CALLER_CALLE_ARGUMENTS,
"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the "
"arguments objects for calls to them")

View File

@ -0,0 +1,326 @@
# Copyright JS Foundation and other contributors, http://js.foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[ECMA_ERROR_MESSAGES]
ECMA_ERR_CANNOT_ACCESS_CALLER_CALLE_ARGUMENTS = "'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them"
ECMA_ERR_PARAMETER_REJECT_MUST_BE_CALLABLE = "'reject' parameter must be callable"
ECMA_ERR_PARAMETER_RESOLVE_MUST_BE_CALLABLE = "'resolve' parameter must be callable"
ECMA_ERR_PROMISE_RESOLVE_ITSELF = "A promise cannot be resolved with itself"
ECMA_ERR_ACCESSOR_WRITABLE = "Accessors cannot be writable"
ECMA_ERR_ARGUMENT_BUFFER_NOT_ARRAY_OR_SHARED_BUFFER = "Argument 'buffer' is not an ArrayBuffer or SharedArrayBuffer"
ECMA_ERR_ARGUMENT_BUFFER_NOT_OBJECT = "Argument 'buffer' is not an object"
ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT = "Argument 'this' is not an ArrayBuffer object"
ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT = "Argument 'this' is not a Boolean object"
ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT = "Argument 'this' is not a Date object"
ECMA_ERR_ARGUMENT_THIS_NOT_PROMISE = "Argument 'this' is not a Promise"
ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER = "Argument 'this' is not a SharedArrayBuffer object"
ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY = "Argument 'this' is not a TypedArray"
ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR = "Argument 'this' is not a constructor"
ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION = "Argument 'this' is not a function"
ECMA_ERR_ARGUMENT_THIS_NOT_GENERATOR_OBJECT = "Argument 'this' is not a generator object"
ECMA_ERR_ARGUMENT_THIS_NOT_NUMBER = "Argument 'this' is not a number or a Number object"
ECMA_ERR_ARGUMENT_THIS_NOT_STRING_OBJECT = "Argument 'this' is not a string or a String object"
ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP = "Argument 'this' is not a valid RegExp"
ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP_OBJECT = "Argument 'this' is not a valid RegExp object"
ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER_OBJECT = "Argument 'this' is not an SharedArrayBuffer object"
ECMA_ERR_ARGUMENT_THIS_NOT_ASYNC_GENERATOR = "Argument 'this' is not an async generator object"
ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR = "Argument 'this' is not an iterator"
ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT = "Argument 'this' is not an object"
ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL = "Argument 'this' must be a Symbol"
ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT = "Argument cannot be converted to an object"
ECMA_ERR_ARGUMENT_NOT_SHARED_ARRAY_BUFFER = "Argument is not SharedArrayBuffer"
ECMA_ERR_ARGUMENT_NOT_ARRAY_BUFFER = "Argument is not an ArrayBuffer"
ECMA_ERR_ARGUMENT_NOT_SUPPORTED = "Argument is not supported"
ECMA_ERR_ARRAY_BUFFER_DETACHED = "ArrayBuffer has already been detached"
ECMA_ERR_ARRAY_BUFFER_RETURNED_THIS_FROM_CONSTRUCTOR = "ArrayBuffer subclass returned this from species constructor"
ECMA_ERR_BIGINT_SERIALIZED = "BigInt cannot be serialized"
ECMA_ERR_BIGINT_ZERO_DIVISION = "BigInt division by zero"
ECMA_ERR_BIGINT_FUNCTION_NOT_CONSTRUCTOR = "BigInt function is not a constructor"
ECMA_ERR_BIGINT_VALUE_EXCPECTED = "BigInt value expected"
ECMA_ERR_BINDING_CANNOT_SET = "Binding cannot be set"
ECMA_ERR_BINDING_NOT_EXIST_OR_UNINITIALIZED = "Binding does not exist or is uninitialised"
ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR = "Built-in routines have no constructor"
ECMA_ERR_CALLBACK_RESULT_NOT_MODULE = "Callback result must be a module"
ECMA_ERR_ALLOCATE_ARRAY_BUFFER = "Cannot allocate memory for ArrayBuffer"
ECMA_ERR_ALLOCATE_BIGINT_VALUE = "Cannot allocate memory for a BigInt value"
ECMA_ERR_ALLOCATE_BIGINT_STRING = "Cannot allocate memory for a string representation of a BigInt value"
ECMA_ERR_CONVERT_BIGINT_TO_NUMBER = "Cannot convert a BigInt value to a number"
ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER = "Cannot convert a Symbol value to a number"
ECMA_ERR_CONVERT_SYMBOL_TO_STRING = "Cannot convert a Symbol value to a string"
ECMA_ERR_CANNOT_CREATE_PROXY = "Cannot create Proxy with a non-object target or handler"
ECMA_ERR_INVOKE_NULLABLE_SUPER_METHOD = "Cannot invoke nullable super method"
ECMA_ERR_LINK_TO_MODULE_IN_ERROR_STATE = "Cannot link to a module which is in error state"
ECMA_ERR_SET_EXTENSIBLE_PROPERTY = "Cannot set [[Extensible]] property of object"
ECMA_ERR_SET_PROTOTYPE = "Cannot set [[Prototype]]"
ECMA_ERR_CLASS_CONSTRUCTOR_REQUIRES_NEW = "Class constructor requires 'new'"
ECMA_ERR_CLASS_EXTENDS_NOT_CONSTRUCTOR = "Class extends value is not a constructor or null"
ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE = "Compare function is not callable"
ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED = "Constant bindings cannot be reassigned"
ECMA_ERR_TYPEDARRAY_SMALLER_THAN_FILTER_CALL_RESULT = "Constructed TypedArray is smaller than filter call result"
ECMA_ERR_CONSTRUCTED_OBJECT_IS_NOT_TYPEDARRAY = "Constructed object is not TypedArray"
ECMA_ERR_CONSTRUCTOR_ARRAYBUFFER_REQUIRES_NEW = "Constructor ArrayBuffer requires 'new'"
ECMA_ERR_CONSTRUCTOR_BIGINT64_ARRAY_REQUIRES_NEW = "Constructor BigInt64Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_BIG_UINT64_ARRAY_REQUIRES_NEW = "Constructor BigUInt64Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_DATAVIEW_REQUIRES_NEW = "Constructor DataView requires 'new'"
ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW = "Constructor Float32Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_FLOAT64_ARRAY_REQUIRES_NEW = "Constructor Float64Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_INT16_ARRAY_REQUIRES_NEW = "Constructor Int16Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_INT32_ARRAY_REQUIRES_NEW = "Constructor Int32Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_INT8_ARRAY_REQUIRES_NEW = "Constructor Int8Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_MAP_REQUIRES_NEW = "Constructor Map requires 'new'"
ECMA_ERR_CONSTRUCTOR_PROMISE_REQUIRES_NEW = "Constructor Promise requires 'new'"
ECMA_ERR_CONSTRUCTOR_PROXY_REQUIRES_NEW = "Constructor Proxy requires 'new'"
ECMA_ERR_CONSTRUCTOR_SET_REQUIRES_NEW = "Constructor Set requires 'new'"
ECMA_ERR_CONSTRUCTOR_SHAREDARRAYBUFFER_REQUIRES_NEW = "Constructor SharedArrayBuffer requires 'new'"
ECMA_ERR_CONSTRUCTOR_UINT16_ARRAY_REQUIRES_NEW = "Constructor Uint16Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_UINT32_ARRAY_REQUIRES_NEW = "Constructor Uint32Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_UINT8_ARRAY_REQUIRES_NEW = "Constructor Uint8Array requires 'new'"
ECMA_ERR_CONSTRUCTOR_UINT8_CLAMPED_ARRAY_REQUIRES_NEW = "Constructor Uint8ClampedArray requires 'new'"
ECMA_ERR_CONSTRUCTOR_WEAKMAP_REQUIRES_NEW = "Constructor WeakMap requires 'new'"
ECMA_ERR_CONSTRUCTOR_WEAKREF_REQUIRES_NEW = "Constructor WeakRef requires 'new'."
ECMA_ERR_CONSTRUCTOR_WEAKSET_REQUIRES_NEW = "Constructor WeakSet requires 'new'"
ECMA_ERR_CONSTRUCTOR_NOT_AN_OBJECT = "Constructor must be an object"
ECMA_ERR_CONTAINER_IS_NOT_A_CONTAINER_OBJECT = "Container is not a container object."
ECMA_ERR_CONTAINER_IS_NOT_AN_OBJECT = "Container is not an object."
ECMA_ERR_DATE_MUST_BE_A_FINITE_NUMBER = "Date must be a finite number"
ECMA_ERR_DERIVED_ARRAY_BUFFER_CTOR_BUFFER_TOO_SMALL = "Derived ArrayBuffer constructor created a too small buffer"
ECMA_ERR_DERIVED_CTOR_RETURN_NOR_OBJECT_OR_UNDEFINED = "Derived constructors may only return object or undefined"
ECMA_ERR_INVALID_CODE_POINT_ERROR = "Error: Invalid code point"
ECMA_ERR_EXPECTED_A_DATAVIEW_OBJECT = "Expected a DataView object"
ECMA_ERR_EXPECTED_A_CONFIGURABLE_PROPERTY = "Expected a configurable property"
ECMA_ERR_EXPECTED_A_FUNCTION_OBJECT = "Expected a function object"
ECMA_ERR_EXPECTED_AN_ARRAYBUFFER = "Expected an ArrayBuffer"
ECMA_ERR_EXPECTED_AN_OBJECT = "Expected an object"
ECMA_ERR_FIRST_ARGUMENT_IS_NOT_A_REALM = "First argument is not a realm"
ECMA_ERR_FIRST_PARAMETER_MUST_BE_CALLABLE = "First parameter must be callable"
ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE = "Fraction digits must be between 0 and 100"
ECMA_ERR_FUNCTION_ADD_ORSET_IS_NOT_CALLABLE = "Function add/set is not callable"
ECMA_ERR_FUNCTION_INDEX_IS_HIGHER_THAN_MAXIMUM = "Function index is higher than maximum"
ECMA_ERR_FUNCTION_PROTOTYPE_NOT_A_CONSTRUCTOR = "Function.prototype is not a constructor"
ECMA_ERR_GENERATOR_IS_CURRENTLY_UNDER_EXECUTION = "Generator is currently under execution"
ECMA_ERR_GETTER_IS_NOT_CALLABLE = "Getter is not callable"
ECMA_ERR_GIVEN_PROPERTY_IS_A_NON_CONFIGURABLE = "Given property is a non-configurable data property on the proxy target"
ECMA_ERR_HANDLER_CANNOT_BE_NULL = "Handler cannot be null"
ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE = "Imported binding shadows local variable"
ECMA_ERR_INCOMPATIBLE_TYPEDARRAY_TYPES = "Incompatible TypedArray types"
ECMA_ERR_INCORRECT_TYPE_FOR_TYPEDARRAY = "Incorrect type for TypedArray"
ECMA_ERR_INCORRECT_RETURN_PROXY_GET_TRAP = "Incorrect value is returned by a Proxy 'get' trap"
ECMA_ERR_INCORRECT_RETURN_PROXY_SET_TRAP = "Incorrect value is returned by a Proxy 'set' trap"
ECMA_ERR_INFINITY_OR_NAN_CANNOT_BE_CONVERTED_TO_BIGINT = "Infinity or NaN cannot be converted to BigInt"
ECMA_ERR_INITIAL_VALUE_CANNOT_BE_UNDEFINED = "Initial value cannot be undefined"
ECMA_ERR_INPUT_MUST_BE_A_VALID_UTF8_STRING = "Input must be a valid utf8 string"
ECMA_ERR_INVALID_ARRAYBUFFER_LENGTH = "Invalid ArrayBuffer length"
ECMA_ERR_INVALID_JSON_FORMAT = "Invalid JSON format"
ECMA_ERR_INVALID_REGEXP_FLAGS = "Invalid RegExp flags"
ECMA_ERR_INVALID_SHARED_ARRAYBUFFER_LENGTH = "Invalid Shared ArrayBuffer length"
ECMA_ERR_INVALID_TYPEDARRAY_LENGTH = "Invalid TypedArray length"
ECMA_ERR_INVALID_UTF8_CHARACTER = "Invalid UTF8 character"
ECMA_ERR_INVALID_UTF8_CODEPOINT = "Invalid UTF8 codepoint"
ECMA_ERR_INVALID_UTF8_STRING = "Invalid UTF8 string"
ECMA_ERR_INVALID_ARGUMENT = "Invalid argument"
ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION = "Invalid argument is passed to RegExp function"
ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE = "Invalid argument type in toPrimitive"
ECMA_ERR_INVALID_CAPABILITY = "Invalid capability"
ECMA_ERR_INVALID_CHARACTER_CLASS = "Invalid character class"
ECMA_ERR_INVALID_CODE_POINT = "Invalid code point"
ECMA_ERR_INVALID_CONTAINER_TYPE = "Invalid container type"
ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE = "Invalid control escape sequence"
ECMA_ERR_INVALID_COUNT_VALUE = "Invalid count value"
ECMA_ERR_INVALID_ESCAPE = "Invalid escape"
ECMA_ERR_INVALID_ESCAPE_SEQUENCE = "Invalid escape sequence"
ECMA_ERR_INVALID_GROUP = "Invalid group"
ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE = "Invalid hex escape sequence"
ECMA_ERR_INVALID_HEXADECIMAL_VALUE = "Invalid hexadecimal value"
ECMA_ERR_INVALID_LENGTH = "Invalid length"
ECMA_ERR_INVALID_NEW_ARRAY_LENGTH = "Invalid new Array length"
ECMA_ERR_INVALID_OFFSET = "Invalid offset"
ECMA_ERR_INVALID_OR_OUT_OF_RANGE_INDEX = "Invalid or out-of-range index"
ECMA_ERR_INVALID_QUANTIFIER = "Invalid quantifier"
ECMA_ERR_INVALID_RANGE_OF_INDEX = "Invalid range of index"
ECMA_ERR_INVALID_SCOPE_CHAIN_INDEX_FOR_EVAL = "Invalid scope chain index for eval"
ECMA_ERR_INVALID_SPECIES_CONSTRUCTOR = "Invalid species constructor"
ECMA_ERR_INVALID_STRING_ = "Invalid string length"
ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE = "Invalid unicode escape sequence"
ECMA_ERR_ITERATOR_NEXT_IS_NOT_CALLABLE = "Iterator 'next' is not callable"
ECMA_ERR_ITERATOR_RETURN_RESULT_IS_NOT_OBJECT = "Iterator 'return' result is not object"
ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE = "Iterator 'throw' is not available"
ECMA_ERR_ITERATOR_IS_NOT_AN_OBJECT = "Iterator is not an object"
ECMA_ERR_ITERATOR_IS_NOT_CALLABLE = "Iterator is not callable"
ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT = "Iterator result is not an object"
ECMA_ERR_ITERATOR_VALUE_IS_NOT_AN_OBJECT = "Iterator value is not an object"
ECMA_ERR_JSON_STRING_PARSE_ERROR = "JSON string parse error"
ECMA_ERR_JSON_STRINGIFY_ERROR = "JSON stringify error"
ECMA_ERR_KEY_MUST_BE_AN_OBJECT = "Key must be an object"
ECMA_ERR_LONE_QUANTIFIER_BRACKET = "Lone quantifier bracket"
ECMA_ERR_MAXIMUM_TYPEDARRAY_SIZE_IS_REACHED = "Maximum TypedArray size is reached"
ECMA_ERR_MAXIMUM_STRING_LENGTH_IS_REACHED = "Maximum string length is reached"
ECMA_ERR_MISSING_ARRAY_ELEMENT = "Missing Array element"
ECMA_ERR_MODULE_CANNOT_BE_INSTANTIATED = "Module cannot be instantiated"
ECMA_ERR_MODULE_EXPORTS_MUST_BE_STRING_VALUES = "Module exports must be string values"
ECMA_ERR_MODULE_EXPORTS_MUST_BE_VALID_IDENTIFIERS = "Module exports must be valid identifiers"
ECMA_ERR_MODULE_IS_IN_ERROR_STATE = "Module is in error state"
ECMA_ERR_MODULE_MUST_BE_IN_LINKED_STATE = "Module must be in linked state"
ECMA_ERR_MODULE_MUST_BE_IN_UNLINKED_STATE = "Module must be in unlinked state"
ECMA_ERR_CALL_SUPER_CONSTRUCTOR_DERIVED_CLASS_BEFORE_THIS = "Must call super constructor in derived class before accessing 'this' or returning from it"
ECMA_ERR_NAMESPACE_OBJECT_IS_NOT_AVAILABLE = "Namespace object is not available"
ECMA_ERR_NEGATIVE_EXPONENT_IS_NOT_ALLOWED_FOR_BIGINTS = "Negative exponent is not allowed for BigInts"
ECMA_ERR_NO_SOURCE_ARGUMENT = "No source argument"
ECMA_ERR_NOTHING_TO_REPEAT = "Nothing to repeat"
ECMA_ERR_OBJECT_CANNOT_BE_FROZEN = "Object cannot be frozen"
ECMA_ERR_OBJECT_CANNOT_BE_SEALED = "Object cannot be sealed"
ECMA_ERR_OBJECT_EXPECTED = "Object expected"
ECMA_ERR_OBJECT_IS_NOT_A_TYPEDARRAY = "Object is not a TypedArray"
ECMA_ERR_ONLY_INTEGER_NUMBERS_CAN_BE_CONVERTED_TO_BIGINT = "Only integer numbers can be converted to BigInt"
ECMA_ERR_OPERATOR_DELETE_RETURNED_FALSE_IN_STRICT_MODE = "Operator delete returned false in strict mode"
ECMA_ERR_PASSED_ARGUMENT_IS_NOT_A_REALM = "Passed argument is not a realm"
ECMA_ERR_PRECISION_DIGITS_MUST_BE_BETWEEN_IN_RANGE = "Precision digits must be between 1 and 100"
ECMA_ERR_PROMISE_ALL_REMAINING_ELEMENTS_LIMIT_REACHED = "Promise.all remaining elements limit reached"
ECMA_ERR_PROPERTY_PROTOTYPE_IS_NOT_AN_OBJECT = "Property 'prototype' is not an object or null"
ECMA_ERR_PROPERTY_NAME_IS_NEITHER_SYMBOL_NOR_STRING = "Property name is neither Symbol nor string"
ECMA_ERR_PROXY_PROPERTY_NOT_CONFIGURABLE_NOT_HAVE_GETTER = "Property of a Proxy is non-configurable and does not have a getter function"
ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID = "Prototype from revoked Proxy is invalid"
ECMA_ERR_PROTOTYPE_IS_NEITHER_OBJECT_NOR_NULL = "Prototype is neither object nor null"
ECMA_ERR_PROXY_HANDLER_IS_NULL_FOR_ISARRAY_OPERATION = "Proxy handler is null for 'isArray' operation"
ECMA_ERR_PROXY_IS_NOT_SUPPORTED = "Proxy is not supported"
ECMA_ERR_TARGET_NOT_EXTENSIBLE_NOT_RETURNED_ITS_PROTOTYPE = "Proxy target is non-extensible, but the trap did not return its actual prototype"
ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH = "Proxy trap returned falsish"
ECMA_ERR_PUSHING_TOO_HIGH_ELEMENT = "Pushing element over 2**53-1 length is disallowed"
ECMA_ERR_MIN_GREATER_THAN_MAX = "Quantifier error: min > max"
ECMA_ERR_RADIX_IS_OUT_OF_RANGE = "Radix must be between 2 and 36"
ECMA_ERR_RANGE_OUT_OF_ORDER_IN_CHARACTER_CLASS = "Range out of order in character class"
ECMA_ERR_REALM_IS_NOT_AVAILABLE = "Realm is not available"
ECMA_ERR_REALMS_ARE_DISABLED = "Realms are disabled"
ECMA_ERR_REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE = "Reduce of empty Array with no initial value"
ECMA_ERR_REFLECT_EXPECTS_AN_OBJECT_AS_SECOND_ARGUMENT = "Reflect.construct expects an object as second argument"
ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG = "RegExp argument should have global flag"
ECMA_ERR_REGEXP_IS_NOT_SUPPORTED = "RegExp is not supported"
ECMA_ERR_REJECT_MUST_BE_UNDEFINED = "Reject must be undefined"
ECMA_ERR_REQUEST_IS_NOT_AVAILABLE = "Request is not available"
ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE = "Resolve method must be callable"
ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED = "Resolve must be undefined"
ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID = "Result of [[DefaultValue]] is invalid"
ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT = "Return value is not an ArrayBuffer object"
ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL = "Return value of 'exec' must be an object or null"
ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED = "Returned ArrayBuffer has been detached"
ECMA_ERR_RIGHT_VALUE_OF_IN_MUST_BE_AN_OBJECT = "Right value of 'in' must be an object"
ECMA_ERR_RIGHT_VALUE_OF_INSTANCEOF_MUST_BE_AN_OBJECT = "Right value of 'instanceof' must be an object"
ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP = "Search string can't be of type: RegExp"
ECMA_ERR_SECOND_ARGUMENT_MUST_BE_AN_OBJECT = "Second argument must be an object"
ECMA_ERR_SPECIES_MUST_BE_A_CONSTRUCTOR = "Species must be a constructor"
ECMA_ERR_STACK_LIMIT_EXCEEDED = "Stack limit exceeded"
ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER = "Start offset is outside the bounds of the buffer"
ECMA_ERR_STATIC_SNAPSHOTS_ARE_NOT_ENABLED = "Static snapshots are not enabled"
ECMA_ERR_STATIC_SNAPSHOTS_CANNOT_BE_COPIED_INTO_MEMORY = "Static snapshots cannot be copied into memory"
ECMA_ERR_STRING_CANNOT_BE_CONVERTED_TO_BIGINT_VALUE = "String cannot be converted to BigInt value"
ECMA_ERR_SUPER_BINDING_MUST_BE_A_CONSTRUCTOR = "Super binding must be a constructor"
ECMA_ERR_SUPER_CONSTRUCTOR_MAY_ONLY_BE_CALLED_ONCE = "Super constructor may only be called once"
ECMA_ERR_SYMBOL_IS_NOT_A_CONSTRUCTOR = "Symbol is not a constructor"
ECMA_ERR_TARGET_IS_NOT_OBJECT = "Target is not Object"
ECMA_ERR_TARGET_IS_NOT_WEAKREF = "Target is not weakRef"
ECMA_ERR_TARGET_NOT_EXTENSIBLE = "Target not extensible"
ECMA_ERR_TARGET_NOT_EXTENSIBLE_DIFFERENT_PROTOTYPE_RETURNED = "Target object is non-extensible and trap returned different prototype"
ECMA_ERR_THE_MAPFN_ARGUMENT_IS_NOT_CALLABLE = "The 'mapfn' argument is not callable"
ECMA_ERR_THE_GIVEN_ARGUMENT_IS_NOT_A_SYMBOL = "The given argument is not a Symbol"
ECMA_ERR_TARGET_PROPERTY_CONFIGURE_ACCESSOR_WITHOUT_SETTER = "The property of a Proxy target is a non configurable accessor without a setter"
ECMA_ERR_THE_REQUESTED_PROPERTY_UPDATE_CANNOT_BE_PERFORMED = "The requested property update cannot be performed"
ECMA_ERR_THE_STRUCTURE_IS_CYCLICAL = "The structure is cyclical"
ECMA_ERR_THE_TWO_DESCRIPTORS_ARE_INCOMPATIBLE = "The two descriptors are incompatible"
ECMA_ERR_TOO_MANY_ARGUMENTS_DECLARED_FOR_FUNCTION_APPLY = "Too many arguments declared for Function.apply"
ECMA_ERR_TRAP_IS_NEITHER_AN_OBJECT_NOR_UNDEFINED = "Trap is neither an object nor undefined"
ECMA_ERR_TRAP_MUST_RETURN_WITH_AN_OBJECT = "Trap must return with an object"
ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_CONFIGURABLE_KEYS = "Trap result did not include all configurable keys"
ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_NON_CONFIGURABLE_KEYS = "Trap result did not include all non-configurable keys"
ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_EXTENSIBILITY = "Trap result does not reflect extensibility of Proxy target"
ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_INEXTENSIBILITY = "Trap result does not reflect inextensibility of Proxy target"
ECMA_ERR_TRAP_EXTRA_KEYS_FOR_A_NON_EXTENSIBLE_TARGET = "Trap returned extra keys for a non-extensible Proxy target"
ECMA_ERR_TRAP_FALSISH_PROPERTY_TARGET_NOT_EXTENSIBLE = "Trap returned falsish for property but the proxy target is not extensible"
ECMA_ERR_TRAP_FALSISH_PROPERTY_NON_CONFIGURABLE = "Trap returned falsish for property which exists in the proxy target as non-configurable"
ECMA_ERR_TRAP_RETURNED_NEITHER_OBJECT_NOR_NULL = "Trap returned neither object nor null"
ECMA_ERR_TRAP_TRUISH_ADDING_PROPERTY_NON_EXTENSIBLE_TARGET = "Trap returned truish for adding property to the non-extensible target"
ECMA_ERR_TRAP_TRUISH_ADD_PROPERTY_INCOMPATIBLE_OTHER_PROP = "Trap returned truish for adding property that is incompatible with the existing property in the target"
ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY = "Trap returned truish for defining non-configurable property which is non-existent in the target"
ECMA_ERR_TRAP_TRUISH_PROPERTY_NON_CONFIGURABLE = "Trap returned truish for property which is non-configurable in the proxy target"
ECMA_ERR_TRAP_TRUISH_TARGET_NOT_EXTENSIBLE = "Trap returned truish for target is not extensible"
ECMA_ERR_TRAP_WITH_DUPLICATED_ENTRIES = "Trap returned with duplicated entries"
ECMA_ERR_TYPEDARRAY_INTRINSTIC_CALLED_BY_NEW_EXPRESSION = "TypedArray intrinstic cannot be called by a 'new' expression"
ECMA_ERR_TYPEDARRAY_INTRINSTIC_DIRECTLY_CALLED = "TypedArray intrinstic cannot be directly called"
ECMA_ERR_CONTENTTYPE_RETURNED_TYPEDARRAY_NOT_MATCH_SOURCE = "TypedArray returned by [[ContentType]] does not match source"
ECMA_ERR_UNARY_PLUS_IS_NOT_ALLOWED_FOR_BIGINTS = "Unary plus is not allowed for BigInts"
ECMA_ERR_UNDEFINED_REFERENCE = "Undefined reference"
ECMA_ERR_UNEXPECTED_END_OF_PATTERN = "Unexpected end of pattern"
ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING = "Unicode surrogate pair missing"
ECMA_ERR_UNMATCHED_CLOSE_BRACKET = "Unmatched close bracket"
ECMA_ERR_UNSHIFT_TOO_HIGH = "Unshift elements over 2**53-1 length is disallowed"
ECMA_ERR_UNSIGNED_RIGHT_SHIFT_IS_NOT_ALLOWED_FOR_BIGINTS = "Unsigned right shift is not allowed for BigInts"
ECMA_ERR_UNSUPPORTED_BINARY_OPERATION = "Unsupported binary operation"
ECMA_ERR_UNSUPPORTED_CONTAINER_OPERATION = "Unsupported container operation"
ECMA_ERR_UNSUPPORTED_SNAPSHOT_EXEC_FLAGS_ARE_SPECIFIED = "Unsupported snapshot exec flags are specified"
ECMA_ERR_UNTERMINATED_CHARACTER_CLASS = "Unterminated character class"
ECMA_ERR_UNTERMINATED_GROUP = "Unterminated group"
ECMA_ERR_VALUE_CANNOT_BE_CONVERTED_TO_BIGINT = "Value cannot be converted to BigInt"
ECMA_ERR_VALUE_FOR_CLASS_HERITAGE_IS_NOT_A_CONSTRUCTOR = "Value for class heritage is not a constructor"
ECMA_ERR_VALUE_RECEIVED_BY_FOR_ASYNC_OF_IS_NOT_OBJECT = "Value received by for-async-of is not object"
ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT = "Value received by yield* is not object"
ECMA_ERR_WEAKREF_TARGET_MUST_BE_AN_OBJECT = "WeakRef target must be an object"
ECMA_ERR_METHOD_RETURN_IS_NOT_CALLABLE = "method 'return' is not callable"
ECMA_ERR_VALUE_MSG = "Argument cannot be marked as error"
ECMA_ERR_WRONG_ARGS_MSG = "This type of argument is not allowed"
ECMA_ERR_PARSER_NOT_SUPPORTED = "Source code parsing is disabled"
ECMA_ERR_JSON_NOT_SUPPORTED = "JSON support is disabled"
ECMA_ERR_SYMBOL_NOT_SUPPORTED = "Symbol support is disabled"
ECMA_ERR_PROMISE_NOT_SUPPORTED = "Promise support is disabled"
ECMA_ERR_TYPED_ARRAY_NOT_SUPPORTED = "TypedArray support is disabled"
ECMA_ERR_SHARED_ARRAYBUFFER_NOT_SUPPORTED = "SharedArrayBuffer support is disabled"
ECMA_ERR_DATA_VIEW_NOT_SUPPORTED = "DataView support is disabled"
ECMA_ERR_BIGINT_NOT_SUPPORTED = "BigInt support is disabled"
ECMA_ERR_CONTAINER_NOT_SUPPORTED = "Container support is disabled"
ECMA_ERR_NOT_MODULE = "Argument is not a module"
ECMA_ERR_UNKNOWN_EXPORT = "Native module export not found"
ECMA_ERR_MODULE_NOT_SUPPORTED = "Module support is disabled"
ECMA_ERR_CALLBACK_IS_NOT_CALLABLE = "Callback function is not callable"
ECMA_ERR_ARRAYBUFFER_IS_DETACHED = "ArrayBuffer has been detached"
ECMA_ERR_CANNOT_CONVERT_TO_OBJECT = "Cannot convert undefined or null to object"
ECMA_ERR_CLASS_IS_NON_CONFIGURABLE = "Prototype property of a class is non-configurable"
ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT = "Argument is not an object"
ECMA_ERR_ARGUMENT_IS_NOT_A_PROXY = "Argument is not a Proxy object"
ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR = "Target is not a constructor"
ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP = "Argument 'this' is not a RegExp object"
ECMA_ERR_INVALID_ARRAY_LENGTH = "Invalid Array length"
ECMA_ERR_LOCAL_VARIABLE_IS_REDECLARED = "Local variable is redeclared"
ECMA_ERR_EXPECTED_A_FUNCTION = "Expected a function"
ECMA_ERR_CLASS_CONSTRUCTOR_NEW = "Class constructor cannot be invoked without 'new'"
ECMA_ERR_LET_CONST_NOT_INITIALIZED = "Variables declared by let/const must be initialized before reading their value"
ECMA_ERR_MAXIMUM_SNAPSHOT_SIZE = "Maximum snapshot size reached"
ECMA_ERR_REGULAR_EXPRESSION_NOT_SUPPORTED = "Regular expression literals are not supported"
ECMA_ERR_SNAPSHOT_BUFFER_SMALL = "Snapshot buffer too small"
ECMA_ERR_SNAPSHOT_FLAG_NOT_SUPPORTED = "Unsupported generate snapshot flags specified"
ECMA_ERR_CANNOT_ALLOCATE_MEMORY_LITERALS = "Cannot allocate memory for literals"
ECMA_ERR_TAGGED_TEMPLATE_LITERALS = "Unsupported feature: tagged template literals"
ECMA_ERR_CONTAINER_NEEDED = "Value is not a Container or Iterator"
ECMA_ERR_INCORRECT_TYPE_CALL = "Operator called on incorrect container type"
ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL = "Invalid type for constructor call"
ECMA_ERR_SCRIPT_GLOBAL_FUNCTIONS_INVOKE_WITH_NEW = "Script (global) functions cannot be invoked with 'new'"
ECMA_ERR_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW = "Generator functions cannot be invoked with 'new'"
ECMA_ERR_ASYNC_FUNCTIONS_INVOKE_WITH_NEW = "Async functions cannot be invoked with 'new'"
ECMA_ERR_ASYNC_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW = "Async generator functions cannot be invoked with 'new'"
ECMA_ERR_ACCESSOR_FUNCTIONS_INVOKE_WITH_NEW = "Accessor functions cannot be invoked with 'new'"
ECMA_ERR_METHODS_INVOKE_WITH_NEW = "Methods cannot be invoked with 'new'"
ECMA_ERR_ARROW_FUNCTIONS_INVOKE_WITH_NEW = "Arrow functions cannot be invoked with 'new'"
ECMA_ERR_ASYNC_ARROW_FUNCTIONS_INVOKE_WITH_NEW = "Async arrow functions cannot be invoked with 'new'"
ECMA_ERR_PROXY_TARGET_IS_NOT_A_CONSTRUCTOR = "Proxy target is not a constructor"
ECMA_ERR_MAXIMUM_CALL_STACK_SIZE_EXCEEDED = "Maximum call stack size exceeded"
ECMA_ERR_INVALID_SNAPSHOT_FORMAT = "Invalid snapshot format"
ECMA_ERR_INVALID_SNAPSHOT_VERSION_OR_FEATURES = "Invalid snapshot version or unsupported features present"
ECMA_ERR_RECEIVER_MUST_BE_AN_OBJECT = "Receiver must be an object"

View File

@ -16,201 +16,56 @@
#include "ecma-errors.h"
#if JERRY_ERROR_MESSAGES
/**
* Error message, if an argument is has an error flag
* Struct to store ecma error message with its size.
*/
const char* const ecma_error_value_msg_p = "Argument cannot be marked as error";
/**
* Error message, if an argument has a wrong type
*/
const char* const ecma_error_wrong_args_msg_p = "This type of argument is not allowed";
#if !JERRY_PARSER
/**
* Error message, if parsing is disabled
*/
const char* const ecma_error_parser_not_supported_p = "Source code parsing is disabled";
#endif /* !JERRY_PARSER */
#if !JERRY_BUILTIN_JSON
/**
* Error message, if JSON support is disabled
*/
const char* const ecma_error_json_not_supported_p = "JSON support is disabled";
#endif /* !JERRY_BUILTIN_JSON */
#if !JERRY_ESNEXT
/**
* Error message, if Symbol support is disabled
*/
const char* const ecma_error_symbol_not_supported_p = "Symbol support is disabled";
/**
* Error message, if Promise support is disabled
*/
const char* const ecma_error_promise_not_supported_p = "Promise support is disabled";
#endif /* !JERRY_ESNEXT */
#if !JERRY_BUILTIN_TYPEDARRAY
/**
* Error message, if TypedArray support is disabled
*/
const char* const ecma_error_typed_array_not_supported_p = "TypedArray support is disabled";
#endif /* !JERRY_BUILTIN_TYPEDARRAY */
#if !JERRY_BUILTIN_SHAREDARRAYBUFFER
/**
* Error message, if SharedArrayBuffer support is disabled
*/
const char* const ecma_error_shared_arraybuffer_not_supported_p = "SharedArrayBuffer support is disabled";
#endif /* !JERRY_BUILTIN_SHAREDARRAYBUFFER */
#if !JERRY_BUILTIN_DATAVIEW
/**
* Error message, if DataView support is disabled
*/
const char* const ecma_error_data_view_not_supported_p = "DataView support is disabled";
#endif /* !JERRY_BUILTIN_DATAVIEW */
#if !JERRY_BUILTIN_BIGINT
/**
* Error message, if BigInt support is disabled
*/
const char* const ecma_error_bigint_not_supported_p = "BigInt support is disabled";
#endif /* !JERRY_BUILTIN_BIGINT */
#if !JERRY_BUILTIN_CONTAINER
/**
* Error message, if Container support is disabled
*/
const char* const ecma_error_container_not_supported_p = "Container support is disabled";
#endif /* JERRY_BUILTIN_CONTAINER */
#if JERRY_MODULE_SYSTEM
/**
* Error message, if argument is not a module
*/
const char* const ecma_error_not_module_p = "Argument is not a module";
/**
* Error message, if a native module export is not found
*/
const char* const ecma_error_unknown_export_p = "Native module export not found";
#else /* !JERRY_MODULE_SYSTEM */
/**
* Error message, if Module support is disabled
*/
const char* const ecma_error_module_not_supported_p = "Module support is disabled";
#endif /* JERRY_MODULE_SYSTEM */
/**
* Error message, if callback function is not callable
*/
const char* const ecma_error_callback_is_not_callable = "Callback function is not callable";
/**
* Error message, if arrayBuffer is detached
*/
const char* const ecma_error_arraybuffer_is_detached = "ArrayBuffer has been detached";
/**
* Error message, cannot convert undefined or null to object
*/
const char* const ecma_error_cannot_convert_to_object = "Cannot convert undefined or null to object";
/**
* Error message, prototype property of a class is non-configurable
*/
const char* const ecma_error_class_is_non_configurable = "Prototype property of a class is non-configurable";
/**
* Error message, argument is not an object
*/
const char* const ecma_error_argument_is_not_an_object = "Argument is not an object";
/**
* Error message length of 'ecma_error_argument_is_not_an_object'
*/
const int ecma_error_argument_is_not_an_object_length = 25;
/**
* Error message, argument is not a Proxy object
*/
const char* const ecma_error_argument_is_not_a_proxy = "Argument is not a Proxy object";
/**
* Error message, target is not a constructor
*/
const char* const ecma_error_target_is_not_a_constructor = "Target is not a constructor";
/**
* Error message, argument is not an regexp
*/
const char* const ecma_error_argument_is_not_an_regexp = "Argument 'this' is not a RegExp object";
/**
* Error message, invalid array length
*/
const char* const ecma_error_invalid_array_length = "Invalid Array length";
/**
* Error message, local variable is redeclared
*/
const char* const ecma_error_local_variable_is_redeclared = "Local variable is redeclared";
/**
* Error message, expected a function
*/
const char* const ecma_error_expected_a_function = "Expected a function";
#if JERRY_ESNEXT
/**
* Error message, class constructor invoked without new keyword
*/
const char* const ecma_error_class_constructor_new = "Class constructor cannot be invoked without 'new'";
/**
* Error message, variables declared by let/const must be initialized before reading their value
*/
const char* const ecma_error_let_const_not_initialized = ("Variables declared by let/const must be"
" initialized before reading their value");
#endif /* JERRY_ESNEXT */
typedef struct
{
lit_utf8_byte_t *text; /* Text of ecma error message. */
uint8_t size; /* Size of ecma error message. */
} ecma_error_message_t;
/* Error message texts with size. */
static ecma_error_message_t ecma_error_messages[] JERRY_ATTR_CONST_DATA = {
{ (lit_utf8_byte_t *) "", 0 }, /* ECMA_ERR_EMPTY */
/** @cond doxygen_suppress */
#define ECMA_ERROR_DEF(id, utf8_string) { (lit_utf8_byte_t *) utf8_string, sizeof (utf8_string) - 1 },
#include "ecma-error-messages.inc.h"
#undef ECMA_ERROR_DEF
/** @endcond */
};
#endif /* JERRY_ERROR_MESSAGES */
#if JERRY_SNAPSHOT_SAVE || JERRY_SNAPSHOT_EXEC
/**
* Get specified ecma error as zero-terminated string
*
* @return pointer to zero-terminated ecma error
*/
const lit_utf8_byte_t *
ecma_get_error_utf8 (uint32_t id) /**< ecma error id */
{
JERRY_ASSERT (id != ECMA_IS_VALID_CONSTRUCTOR);
#if JERRY_ERROR_MESSAGES
return ecma_error_messages[id].text;
#else /* !JERRY_ERROR_MESSAGES */
return NULL;
#endif /* JERRY_ERROR_MESSAGES */
} /* ecma_get_error_utf8 */
/**
* Error message, maximum snapshot size reached
* Get size of specified ecma error
*
* @return size in bytes
*/
const char* const ecma_error_maximum_snapshot_size = "Maximum snapshot size reached";
lit_utf8_size_t
ecma_get_error_size (uint32_t id) /**< ecma error id */
{
JERRY_ASSERT (id != ECMA_IS_VALID_CONSTRUCTOR);
/**
* Error message, regular expressions literals are not supported
*/
const char* const ecma_error_regular_expression_not_supported = "Regular expression literals are not supported";
/**
* Error message, snapshot buffer too small
*/
const char* const ecma_error_snapshot_buffer_small = "Snapshot buffer too small";
/**
* Error message, Unsupported generate snapshot flags specified
*/
const char* const ecma_error_snapshot_flag_not_supported = "Unsupported generate snapshot flags specified";
/**
* Error message, Cannot allocate memory for literals
*/
const char* const ecma_error_cannot_allocate_memory_literals = "Cannot allocate memory for literals";
/**
* Error message, Unsupported feature: tagged template literals
*/
const char* const ecma_error_tagged_template_literals = "Unsupported feature: tagged template literals";
#endif /* JERRY_SNAPSHOT_SAVE || JERRY_SNAPSHOT_EXEC */
#if JERRY_ERROR_MESSAGES
return ecma_error_messages[id].size;
#else /* !JERRY_ERROR_MESSAGES */
return 0;
#endif /* JERRY_ERROR_MESSAGES */
} /* ecma_get_error_size */

View File

@ -13,82 +13,27 @@
* limitations under the License.
*/
#include "config.h"
#ifndef ECMA_ERRORS_H
#define ECMA_ERRORS_H
#include "lit-globals.h"
typedef enum
{
ECMA_ERR_EMPTY,
/** @cond doxygen_suppress */
#if JERRY_ERROR_MESSAGES
extern const char* const ecma_error_value_msg_p;
extern const char* const ecma_error_wrong_args_msg_p;
#if !JERRY_PARSER
extern const char* const ecma_error_parser_not_supported_p;
#endif /* !JERRY_PARSER */
#if !JERRY_BUILTIN_JSON
extern const char* const ecma_error_json_not_supported_p;
#endif /* !JERRY_BUILTIN_JSON */
#if !JERRY_ESNEXT
extern const char* const ecma_error_symbol_not_supported_p;
extern const char* const ecma_error_promise_not_supported_p;
#endif /* !JERRY_ESNEXT */
#if !JERRY_BUILTIN_TYPEDARRAY
extern const char* const ecma_error_typed_array_not_supported_p;
#endif /* !JERRY_BUILTIN_TYPEDARRAY */
#if !JERRY_BUILTIN_SHAREDARRAYBUFFER
extern const char* const ecma_error_shared_arraybuffer_not_supported_p;
#endif /* !JERRY_BUILTIN_SHAREDARRAYBUFFER */
#if !JERRY_BUILTIN_DATAVIEW
extern const char* const ecma_error_data_view_not_supported_p;
#endif /* !JERRY_BUILTIN_DATAVIEW */
#if !JERRY_BUILTIN_BIGINT
extern const char* const ecma_error_bigint_not_supported_p;
#endif /* !JERRY_BUILTIN_BIGINT */
#if !JERRY_BUILTIN_CONTAINER
extern const char* const ecma_error_container_not_supported_p;
#endif /* !JERRY_BUILTIN_CONTAINER */
#if JERRY_MODULE_SYSTEM
extern const char* const ecma_error_not_module_p;
extern const char* const ecma_error_unknown_export_p;
#else /* !JERRY_MODULE_SYSTEM */
extern const char* const ecma_error_module_not_supported_p;
#endif /* JERRY_MODULE_SYSTEM */
extern const char* const ecma_error_callback_is_not_callable;
extern const char* const ecma_error_arraybuffer_is_detached;
extern const char* const ecma_error_cannot_convert_to_object;
extern const char* const ecma_error_class_is_non_configurable;
extern const char* const ecma_error_argument_is_not_an_object;
extern const int ecma_error_argument_is_not_an_object_length;
extern const char* const ecma_error_argument_is_not_a_proxy;
extern const char* const ecma_error_target_is_not_a_constructor;
extern const char* const ecma_error_argument_is_not_an_regexp;
extern const char* const ecma_error_invalid_array_length;
extern const char* const ecma_error_local_variable_is_redeclared;
extern const char* const ecma_error_expected_a_function;
#if JERRY_ESNEXT
extern const char* const ecma_error_class_constructor_new;
extern const char* const ecma_error_let_const_not_initialized;
#endif /* JERRY_ESNEXT */
#define ECMA_ERROR_DEF(id, ascii_zt_string) id,
#else /* !JERRY_ERROR_MESSAGES */
#define ECMA_ERROR_DEF(id, ascii_zt_string) id = ECMA_ERR_EMPTY,
#endif /* JERRY_ERROR_MESSAGES */
#include "ecma-error-messages.inc.h"
#undef ECMA_ERROR_DEF
/** @endcond */
ECMA_IS_VALID_CONSTRUCTOR /* used as return value when checking constructor */
} ecma_error_msg_t;
const lit_utf8_byte_t* ecma_get_error_utf8 (uint32_t id);
lit_utf8_size_t ecma_get_error_size (uint32_t id);
/* snapshot errors */
extern const char* const ecma_error_maximum_snapshot_size;
extern const char* const ecma_error_regular_expression_not_supported;
extern const char* const ecma_error_snapshot_buffer_small;
extern const char* const ecma_error_snapshot_flag_not_supported;
extern const char* const ecma_error_cannot_allocate_memory_literals;
extern const char* const ecma_error_tagged_template_literals;
#endif /* !ECMA_ERRORS_H */

View File

@ -2272,14 +2272,14 @@ typedef struct
* Check the current stack usage. If the limit is reached a RangeError is raised.
* The macro argument specifies the return value which is usally ECMA_VALUE_ERROR or NULL.
*/
#define ECMA_CHECK_STACK_USAGE_RETURN(RETURN_VALUE) \
do \
{ \
if (ecma_get_current_stack_usage () > CONFIG_MEM_STACK_LIMIT) \
{ \
ecma_raise_range_error (ECMA_ERR_MSG ("Maximum call stack size exceeded")); \
return RETURN_VALUE; \
} \
#define ECMA_CHECK_STACK_USAGE_RETURN(RETURN_VALUE) \
do \
{ \
if (ecma_get_current_stack_usage () > CONFIG_MEM_STACK_LIMIT) \
{ \
ecma_raise_maximum_callstack_error (); \
return RETURN_VALUE; \
} \
} while (0)
/**

View File

@ -2625,7 +2625,7 @@ ecma_string_pad (ecma_value_t original_string_p, /**< Input ecma string */
if (int_max_length >= UINT32_MAX)
{
ecma_deref_ecma_string (filler_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum string length is reached"));
return ecma_raise_range_error (ECMA_ERR_MAXIMUM_STRING_LENGTH_IS_REACHED);
}
/* 9 */

View File

@ -468,7 +468,7 @@ ecma_is_value_array (ecma_value_t arg) /**< argument */
if (proxy_obj_p->handler == ECMA_VALUE_NULL)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Proxy handler is null for 'isArray' operation"));
return ecma_raise_type_error (ECMA_ERR_PROXY_HANDLER_IS_NULL_FOR_ISARRAY_OPERATION);
}
return ecma_is_value_array (proxy_obj_p->target);

View File

@ -282,7 +282,7 @@ ecma_module_resolve_throw (ecma_module_resolve_result_t *resolve_result_p, /**<
JERRY_UNUSED (resolve_result_p);
JERRY_UNUSED (name_p);
return ecma_raise_syntax_error (NULL);
return ecma_raise_syntax_error (ECMA_ERR_EMPTY);
#endif /* !JERRY_ERROR_MESSAGES */
} /* ecma_module_resolve_throw */
@ -540,7 +540,7 @@ ecma_module_evaluate (ecma_module_t *module_p) /**< module */
{
if (module_p->header.u.cls.u1.module_state == JERRY_MODULE_STATE_ERROR)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Module is in error state"));
return ecma_raise_range_error (ECMA_ERR_MODULE_IS_IN_ERROR_STATE);
}
if (module_p->header.u.cls.u1.module_state >= JERRY_MODULE_STATE_EVALUATING)
@ -947,7 +947,7 @@ ecma_module_connect_imports (ecma_module_t *module_p)
if (binding_p != NULL)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Imported binding shadows local variable"));
return ecma_raise_syntax_error (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE);
}
ecma_value_t status = ecma_op_has_binding (lex_env_p, import_names_p->local_name_p);
@ -961,7 +961,7 @@ ecma_module_connect_imports (ecma_module_t *module_p)
if (ecma_is_value_true (status))
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Imported binding shadows local variable"));
return ecma_raise_syntax_error (ECMA_ERR_IMPORTED_BINDING_SHADOWS_LOCAL_VARIABLE);
}
import_names_p = import_names_p->next_p;
@ -1104,7 +1104,7 @@ ecma_module_link (ecma_module_t *module_p, /**< root module */
{
if (module_p->header.u.cls.u1.module_state != JERRY_MODULE_STATE_UNLINKED)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Module must be in unlinked state"));
return ecma_raise_type_error (ECMA_ERR_MODULE_MUST_BE_IN_UNLINKED_STATE);
}
module_p->header.u.cls.u1.module_state = JERRY_MODULE_STATE_LINKING;
@ -1152,7 +1152,7 @@ restart:
if (resolved_module_p == NULL)
{
ecma_free_value (resolve_result);
ecma_raise_type_error (ECMA_ERR_MSG ("Callback result must be a module"));
ecma_raise_type_error (ECMA_ERR_CALLBACK_RESULT_NOT_MODULE);
goto error;
}
@ -1167,7 +1167,7 @@ restart:
if (resolved_module_p->header.u.cls.u1.module_state == JERRY_MODULE_STATE_ERROR)
{
ecma_raise_type_error (ECMA_ERR_MSG ("Cannot link to a module which is in error state"));
ecma_raise_type_error (ECMA_ERR_LINK_TO_MODULE_IN_ERROR_STATE);
goto error;
}
@ -1404,7 +1404,7 @@ ecma_module_import (ecma_value_t specifier, /**< module specifier */
return result;
error_module_instantiate:
ecma_raise_range_error (ECMA_ERR_MSG ("Module cannot be instantiated"));
ecma_raise_range_error (ECMA_ERR_MODULE_CANNOT_BE_INSTANTIATED);
error:
if (jcontext_has_pending_abort ())

View File

@ -70,7 +70,7 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
/* 1 - 2. */
if (!ecma_is_value_object (this_val))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@ -79,7 +79,7 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
/* 3. */
if (!ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_ARRAY_ITERATOR))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR);
}
ecma_value_t iterated_value = ext_obj_p->u.cls.u3.iterated_value;
@ -100,7 +100,7 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (array_object_p);
if (ecma_arraybuffer_is_detached (arraybuffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
/* b. */

View File

@ -434,7 +434,7 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /
{
if ((ecma_number_t) (length + arguments_number) > UINT32_MAX)
{
return ecma_raise_range_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
return ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
if (arguments_number == 0)
@ -460,7 +460,7 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /
/* 5. */
if ((ecma_number_t) (length + arguments_number) > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Pushing element over 2**53-1 length is disallowed"));
return ecma_raise_type_error (ECMA_ERR_PUSHING_TOO_HIGH_ELEMENT);
}
/* 6. */
@ -1089,7 +1089,7 @@ ecma_builtin_array_prototype_object_sort (ecma_value_t this_arg, /**< this argum
/* Check if the provided compare function is callable. */
if (!ecma_is_value_undefined (arg1) && !ecma_op_is_callable (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Compare function is not callable"));
return ecma_raise_type_error (ECMA_ERR_COMPARE_FUNC_NOT_CALLABLE);
}
ecma_length_t len;
@ -1284,7 +1284,7 @@ ecma_builtin_array_prototype_object_splice (const ecma_value_t args[], /**< argu
/* ES11: 8. */
if ((ecma_number_t) new_length > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid new Array length"));
return ecma_raise_type_error (ECMA_ERR_INVALID_NEW_ARRAY_LENGTH);
}
/* ES11: 9. */
@ -1486,7 +1486,7 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg
{
if (args_number > UINT32_MAX - len)
{
return ecma_raise_range_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
return ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
if (args_number == 0)
@ -1523,7 +1523,7 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg
/* ES11:4.a. */
if ((ecma_number_t) (len + args_number) > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Unshift elements over 2**53-1 length is disallowed"));
return ecma_raise_type_error (ECMA_ERR_UNSHIFT_TOO_HIGH);
}
#endif /* JERRY_ESNEXT */
@ -1854,7 +1854,7 @@ ecma_builtin_array_apply (ecma_value_t arg1, /**< callbackfn */
/* 4. */
if (!ecma_op_is_callable (arg1))
{
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);
}
/* We already checked that arg1 is callable */
@ -1937,7 +1937,7 @@ ecma_builtin_array_prototype_object_map (ecma_value_t arg1, /**< callbackfn */
/* 4. */
if (!ecma_op_is_callable (arg1))
{
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);
}
/* 6. */
@ -2028,7 +2028,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t arg1, /**< callbackfn *
/* 4. */
if (!ecma_op_is_callable (arg1))
{
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);
}
/* 6. */
@ -2133,13 +2133,13 @@ ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's argu
/* 4. */
if (!ecma_op_is_callable (args_p[0]))
{
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);
}
/* 5. */
if (len == 0 && args_number == 1)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Reduce of empty Array with no initial value"));
return ecma_raise_type_error (ECMA_ERR_REDUCE_OF_EMPTY_ARRAY_WITH_NO_INITIAL_VALUE);
}
JERRY_ASSERT (ecma_is_value_object (args_p[0]));
@ -2191,7 +2191,7 @@ ecma_builtin_array_reduce_from (const ecma_value_t args_p[], /**< routine's argu
/* 8.c */
if (!k_present)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Missing Array element"));
return ecma_raise_type_error (ECMA_ERR_MISSING_ARRAY_ELEMENT);
}
}
/* 9. */
@ -2343,7 +2343,7 @@ ecma_builtin_array_prototype_object_find (ecma_value_t predicate, /**< callback
/* 5. */
if (!ecma_op_is_callable (predicate))
{
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);
}
/* We already checked that predicate is callable, so it will always be an object. */
@ -2825,7 +2825,7 @@ ecma_builtin_array_prototype_object_flat_map (ecma_value_t callback, /**< callba
{
if (!ecma_op_is_callable (callback))
{
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);
}
/* 4. */

View File

@ -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));

View File

@ -66,7 +66,7 @@ ecma_builtin_arraybuffer_prototype_bytelength_getter (ecma_value_t this_arg) /**
{
if (ecma_arraybuffer_is_detached (object_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
uint32_t len = ecma_arraybuffer_get_length (object_p);
@ -74,7 +74,7 @@ ecma_builtin_arraybuffer_prototype_bytelength_getter (ecma_value_t this_arg) /**
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a ArrayBuffer object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT);
} /* ecma_builtin_arraybuffer_prototype_bytelength_getter */
/**
@ -93,7 +93,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
{
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
@ -101,7 +101,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 2. */
if (!ecma_object_class_is (object_p, ECMA_OBJECT_CLASS_ARRAY_BUFFER))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an ArrayBuffer object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ARRAY_BUFFER_OBJECT);
}
return ecma_builtin_arraybuffer_slice (this_arg, argument_list_p, arguments_number);

View File

@ -76,7 +76,7 @@ ecma_builtin_arraybuffer_dispatch_call (const ecma_value_t *arguments_list_p, /*
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor ArrayBuffer requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_ARRAYBUFFER_REQUIRES_NEW);
} /* ecma_builtin_arraybuffer_dispatch_call */
/**

View File

@ -255,9 +255,8 @@ ecma_builtin_async_from_sync_iterator_prototype_do (ecma_async_from_sync_iterato
ecma_free_value (call_result);
#if JERRY_ERROR_MESSAGES
const lit_utf8_byte_t *msg_p = (const lit_utf8_byte_t *) ecma_error_argument_is_not_an_object;
lit_utf8_size_t msg_size = (lit_utf8_size_t) ecma_error_argument_is_not_an_object_length;
JERRY_ASSERT (lit_zt_utf8_string_size (msg_p) == msg_size);
const lit_utf8_byte_t *msg_p = ecma_get_error_utf8 (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
lit_utf8_size_t msg_size = ecma_get_error_size (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
ecma_string_t *error_msg_p = ecma_new_ecma_string_from_ascii (msg_p, msg_size);
#else /* !JERRY_ERROR_MESSAGES */
ecma_string_t *error_msg_p = ecma_get_magic_string (LIT_MAGIC_STRING__EMPTY);

View File

@ -111,7 +111,7 @@ ecma_builtin_async_generator_prototype_dispatch_routine (uint8_t builtin_routine
if (executable_object_p == NULL)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an async generator object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ASYNC_GENERATOR);
}
if (executable_object_p->extended_object.u.cls.u2.executable_obj_flags & ECMA_EXECUTABLE_OBJECT_COMPLETED)

View File

@ -82,7 +82,7 @@ ecma_builtin_bigint_prototype_object_value_of (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("BigInt value expected"));
return ecma_raise_type_error (ECMA_ERR_BIGINT_VALUE_EXCPECTED);
} /* ecma_builtin_bigint_prototype_object_value_of */
/**
@ -112,7 +112,7 @@ ecma_builtin_bigint_prototype_object_to_string (ecma_value_t this_arg, /**< this
if (arg_num < 2 || arg_num > 36)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36"));
return ecma_raise_range_error (ECMA_ERR_RADIX_IS_OUT_OF_RANGE);
}
radix = (uint32_t) arg_num;

View File

@ -68,7 +68,7 @@ ecma_builtin_bigint_dispatch_construct (const ecma_value_t *arguments_list_p, /*
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("BigInt function is not a constructor"));
return ecma_raise_type_error (ECMA_ERR_BIGINT_FUNCTION_NOT_CONSTRUCTOR);
} /* ecma_builtin_bigint_dispatch_construct */
/**

View File

@ -89,7 +89,7 @@ ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Boolean object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_BOOLEAN_OBJECT);
} /* ecma_builtin_boolean_prototype_object_value_of */
/**

View File

@ -122,7 +122,7 @@ ecma_builtin_dataview_prototype_object_getters (ecma_value_t this_arg, /**< this
{
if (ecma_arraybuffer_is_detached (obj_p->buffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
return ecma_make_uint32_value (obj_p->header.u.cls.u3.length);
}
@ -132,7 +132,7 @@ ecma_builtin_dataview_prototype_object_getters (ecma_value_t this_arg, /**< this
if (ecma_arraybuffer_is_detached (obj_p->buffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
return ecma_make_uint32_value (obj_p->byte_offset);
}

View File

@ -47,7 +47,7 @@ ecma_builtin_dataview_dispatch_call (const ecma_value_t *arguments_list_p, /**<
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor DataView requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_DATAVIEW_REQUIRES_NEW);
} /* ecma_builtin_dataview_dispatch_call */
/**

View File

@ -214,7 +214,7 @@ ecma_builtin_date_prototype_to_primitive (ecma_value_t this_arg, /**< this argum
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type in toPrimitive"));
return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_TYPE_IN_TOPRIMITIVE);
} /* ecma_builtin_date_prototype_to_primitive */
#endif /* JERRY_ESNEXT */
@ -638,7 +638,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
if (!ecma_is_value_object (this_arg)
|| !ecma_object_class_is (ecma_get_object_from_value (this_arg), ECMA_OBJECT_CLASS_DATE))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Date object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT);
}
ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg);
@ -712,7 +712,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
{
if (ecma_number_is_nan (date_value))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Date must be a finite number"));
return ecma_raise_range_error (ECMA_ERR_DATE_MUST_BE_A_FINITE_NUMBER);
}
return ecma_date_value_to_iso_string (date_value);

View File

@ -101,7 +101,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
/* 2. */
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);

View File

@ -217,7 +217,7 @@ ecma_builtin_function_prototype_object_apply (ecma_object_t *func_obj_p, /**< th
/* 3. */
if (!ecma_is_value_object (arg2))
{
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 = ecma_get_object_from_value (arg2);
@ -233,7 +233,7 @@ ecma_builtin_function_prototype_object_apply (ecma_object_t *func_obj_p, /**< th
if (length >= ECMA_FUNCTION_APPLY_ARGUMENT_COUNT_LIMIT)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Too many arguments declared for Function.apply"));
return ecma_raise_range_error (ECMA_ERR_TOO_MANY_ARGUMENTS_DECLARED_FOR_FUNCTION_APPLY);
}
/* 6. */
@ -498,7 +498,7 @@ ecma_builtin_function_prototype_dispatch_construct (const ecma_value_t *argument
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Function.prototype is not a constructor"));
return ecma_raise_type_error (ECMA_ERR_FUNCTION_PROTOTYPE_NOT_A_CONSTRUCTOR);
} /* ecma_builtin_function_prototype_dispatch_construct */
/**
@ -523,7 +523,7 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /*
}
#endif /* JERRY_ESNEXT */
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION);
}
ecma_object_t *func_obj_p = ecma_get_object_from_value (this_arg);

View File

@ -223,12 +223,12 @@ ecma_builtin_generator_prototype_dispatch_routine (uint8_t builtin_routine_id, /
if (executable_object_p == NULL)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a generator object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_GENERATOR_OBJECT);
}
if (executable_object_p->extended_object.u.cls.u2.executable_obj_flags & ECMA_EXECUTABLE_OBJECT_RUNNING)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Generator is currently under execution"));
return ecma_raise_type_error (ECMA_ERR_GENERATOR_IS_CURRENTLY_UNDER_EXECUTION);
}
if (executable_object_p->extended_object.u.cls.u2.executable_obj_flags & ECMA_EXECUTABLE_OBJECT_COMPLETED)

View File

@ -210,7 +210,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
if (hex_value == UINT32_MAX)
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid hexadecimal value"));
return ecma_raise_uri_error (ECMA_ERR_INVALID_HEXADECIMAL_VALUE);
}
ecma_char_t decoded_byte = (ecma_char_t) hex_value;
@ -248,7 +248,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
else
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 character"));
return ecma_raise_uri_error (ECMA_ERR_INVALID_UTF8_CHARACTER);
}
lit_utf8_byte_t octets[LIT_UTF8_MAX_BYTES_IN_CODE_POINT];
@ -280,7 +280,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
if (!is_valid || !lit_is_valid_utf8_string (octets, bytes_count, true))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 string"));
return ecma_raise_uri_error (ECMA_ERR_INVALID_UTF8_STRING);
}
lit_code_point_t cp;
@ -289,7 +289,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
if (lit_is_code_point_utf16_high_surrogate (cp) || lit_is_code_point_utf16_low_surrogate (cp))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 codepoint"));
return ecma_raise_uri_error (ECMA_ERR_INVALID_UTF8_CODEPOINT);
}
lit_utf8_byte_t result_chars[LIT_CESU8_MAX_BYTES_IN_CODE_POINT];
@ -348,7 +348,7 @@ ecma_builtin_global_object_encode_uri_helper (lit_utf8_byte_t *input_start_p, /*
if (lit_is_code_point_utf16_low_surrogate (ch))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing"));
return ecma_raise_uri_error (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING);
}
lit_code_point_t cp = ch;
@ -358,7 +358,7 @@ ecma_builtin_global_object_encode_uri_helper (lit_utf8_byte_t *input_start_p, /*
if (input_char_p == input_end_p)
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing"));
return ecma_raise_uri_error (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING);
}
ecma_char_t next_ch;
@ -372,7 +372,7 @@ ecma_builtin_global_object_encode_uri_helper (lit_utf8_byte_t *input_start_p, /*
else
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing"));
return ecma_raise_uri_error (ECMA_ERR_UNICODE_SURROGATE_PAIR_MISSING);
}
}

View File

@ -368,7 +368,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array *
/* 4 . */
if ((ecma_number_t) (*length_p + arg_len) > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
return ecma_raise_type_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
#else /* !JERRY_ESNEXT */
/* 5.b.ii */
@ -591,7 +591,7 @@ ecma_builtin_helper_string_prototype_object_index_of (ecma_string_t *original_st
if (regexp == ECMA_VALUE_TRUE)
{
JERRY_ASSERT (ECMA_STRING_LAST_INDEX_OF < mode && mode <= ECMA_STRING_ENDS_WITH);
return ecma_raise_type_error (ECMA_ERR_MSG ("Search string can't be of type: RegExp"));
return ecma_raise_type_error (ECMA_ERR_SEARCH_STRING_CANNOT_BE_OF_TYPE_REGEXP);
}
}
#endif /* JERRY_ESNEXT */

View File

@ -172,12 +172,12 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
{
if (!ecma_is_typedarray (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY);
}
if (ecma_arraybuffer_is_detached (ecma_typedarray_get_arraybuffer (ecma_get_object_from_value (this_arg))))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
return ecma_typedarray_iterators_helper (this_arg, ECMA_ITERATOR_VALUES);
@ -208,7 +208,7 @@ ecma_builtin_intrinsic_dispatch_routine (uint8_t builtin_routine_id, /**< built-
if (!ecma_is_value_object (this_arg)
|| !ecma_object_class_is (ecma_get_object_from_value (this_arg), ECMA_OBJECT_CLASS_DATE))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Date object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_DATE_OBJECT);
}
#if JERRY_ESNEXT

View File

@ -811,7 +811,7 @@ ecma_builtin_json_parse_buffer (const lit_utf8_byte_t *str_start_p, /**< String
ecma_free_value (result);
}
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid JSON format"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_JSON_FORMAT);
} /* ecma_builtin_json_parse_buffer */
/**
@ -987,7 +987,7 @@ ecma_builtin_json_serialize_object (ecma_json_stringify_context_t *context_p, /*
/* 1. */
if (ecma_json_has_object_in_stack (context_p->occurrence_stack_last_p, obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical"));
return ecma_raise_type_error (ECMA_ERR_THE_STRUCTURE_IS_CYCLICAL);
}
/* 2. */
@ -1124,7 +1124,7 @@ ecma_builtin_json_serialize_array (ecma_json_stringify_context_t *context_p, /**
/* 1. */
if (ecma_json_has_object_in_stack (context_p->occurrence_stack_last_p, obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical"));
return ecma_raise_type_error (ECMA_ERR_THE_STRUCTURE_IS_CYCLICAL);
}
/* 2. */
@ -1414,7 +1414,7 @@ ecma_builtin_json_serialize_property (ecma_json_stringify_context_t *context_p,
if (ecma_is_value_bigint (value))
{
ecma_free_value (value);
return ecma_raise_type_error (ECMA_ERR_MSG ("BigInt cannot be serialized"));
return ecma_raise_type_error (ECMA_ERR_BIGINT_SERIALIZED);
}
#endif /* JERRY_BUILTIN_BIGINT */

View File

@ -47,7 +47,7 @@ ecma_builtin_map_dispatch_call (const ecma_value_t *arguments_list_p, /**< argum
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Map requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_MAP_REQUIRES_NEW);
} /* ecma_builtin_map_dispatch_call */
/**

View File

@ -165,7 +165,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /
if (radix < 2 || radix > 36)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36"));
return ecma_raise_range_error (ECMA_ERR_RADIX_IS_OUT_OF_RANGE);
}
}
@ -451,7 +451,7 @@ ecma_builtin_number_prototype_object_value_of (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a number or a Number object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_NUMBER);
} /* ecma_builtin_number_prototype_object_value_of */
/**
@ -489,7 +489,7 @@ ecma_builtin_number_prototype_object_to_number_convert (ecma_number_t this_num,
/* Argument boundary check for toFixed method */
if (mode == NUMBER_ROUTINE_TO_FIXED && (arg_num <= -1 || arg_num >= 101))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 100"));
return ecma_raise_range_error (ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE);
}
/* Handle NaN separately */
@ -557,12 +557,12 @@ ecma_builtin_number_prototype_object_to_number_convert (ecma_number_t this_num,
if (mode == NUMBER_ROUTINE_TO_EXPONENTIAL && (arg_num <= -1 || arg_num >= 101))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 100"));
return ecma_raise_range_error (ECMA_ERR_FRACTION_DIGITS_OUT_OF_RANGE);
}
else if (mode == NUMBER_ROUTINE_TO_PRECISION && (arg_num < 1 || arg_num > 100))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_range_error (ECMA_ERR_MSG ("Precision digits must be between 1 and 100"));
return ecma_raise_range_error (ECMA_ERR_PRECISION_DIGITS_MUST_BE_BETWEEN_IN_RANGE);
}
num_of_digits = ecma_number_to_decimal (this_num, digits, &exponent);

View File

@ -241,7 +241,7 @@ ecma_builtin_object_prototype_define_getter_setter (ecma_value_t this_arg, /**<
if (!ecma_op_is_callable (accessor))
{
ecma_deref_object (obj_p);
return ecma_raise_type_error (ECMA_ERR_MSG ("Getter is not callable"));
return ecma_raise_type_error (ECMA_ERR_GETTER_IS_NOT_CALLABLE);
}
ecma_object_t *accessor_obj_p = ecma_get_object_from_value (accessor);

View File

@ -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 */

View File

@ -98,7 +98,7 @@ ecma_builtin_promise_perform_race (ecma_value_t iterator, /**< the iterator for
if (!ecma_op_is_callable (resolve))
{
ecma_free_value (resolve);
return ecma_raise_type_error (ECMA_ERR_MSG ("Resolve method must be callable"));
return ecma_raise_type_error (ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE);
}
ecma_object_t *resolve_func_p = ecma_get_object_from_value (resolve);
@ -196,7 +196,7 @@ ecma_builtin_promise_perform (ecma_value_t iterator, /**< iteratorRecord */
if (!ecma_op_is_callable (resolve))
{
ecma_free_value (resolve);
return ecma_raise_type_error (ECMA_ERR_MSG ("Resolve method must be callable"));
return ecma_raise_type_error (ECMA_ERR_RESOLVE_METHOD_MUST_BE_CALLABLE);
}
ecma_object_t *resolve_func_p = ecma_get_object_from_value (resolve);
@ -281,7 +281,7 @@ ecma_builtin_promise_perform (ecma_value_t iterator, /**< iteratorRecord */
if (JERRY_UNLIKELY (idx == UINT32_MAX - 1))
{
ecma_raise_range_error (ECMA_ERR_MSG ("Promise.all remaining elements limit reached"));
ecma_raise_range_error (ECMA_ERR_PROMISE_ALL_REMAINING_ELEMENTS_LIMIT_REACHED);
goto exit;
}
@ -456,7 +456,7 @@ ecma_builtin_promise_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Promise requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_PROMISE_REQUIRES_NEW);
} /* ecma_builtin_promise_dispatch_call */
/**
@ -472,7 +472,7 @@ ecma_builtin_promise_dispatch_construct (const ecma_value_t *arguments_list_p, /
if (arguments_list_len == 0 || !ecma_op_is_callable (arguments_list_p[0]))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("First parameter must be callable"));
return ecma_raise_type_error (ECMA_ERR_FIRST_PARAMETER_MUST_BE_CALLABLE);
}
return ecma_op_create_promise_object (arguments_list_p[0],

View File

@ -93,7 +93,7 @@ ecma_builtin_proxy_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
/* 1. */
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Proxy requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_PROXY_REQUIRES_NEW);
} /* ecma_builtin_proxy_dispatch_call */
/**

View File

@ -91,7 +91,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
/* 1. */
if (arguments_number == 0 || !ecma_is_value_object (arguments_list[0]))
{
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);
}
/* 2. */
@ -158,7 +158,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
/* 1. */
if (arguments_number == 0 || !ecma_is_value_object (arguments_list[0]))
{
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 *target_p = ecma_get_object_from_value (arguments_list[0]);
@ -182,7 +182,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
/* 1. */
if (arguments_number < 1 || !ecma_is_constructor (arguments_list[0]))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_target_is_not_a_constructor));
return ecma_raise_type_error (ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR);
}
ecma_object_t *target_p = ecma_get_object_from_value (arguments_list[0]);
@ -195,7 +195,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
/* 3. */
if (!ecma_is_constructor (arguments_list[2]))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_target_is_not_a_constructor));
return ecma_raise_type_error (ECMA_ERR_TARGET_IS_NOT_A_CONSTRUCTOR);
}
new_target_p = ecma_get_object_from_value (arguments_list[2]);
@ -204,7 +204,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
/* 4. */
if (arguments_number < 2)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Reflect.construct expects an object as second argument"));
return ecma_raise_type_error (ECMA_ERR_REFLECT_EXPECTS_AN_OBJECT_AS_SECOND_ARGUMENT);
}
ecma_collection_t *coll_p = ecma_op_create_list_from_array_like (arguments_list[1], false);
@ -222,7 +222,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
if (!ecma_is_value_object (arguments_list[0]))
{
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);
}
switch (builtin_routine_id)
@ -235,7 +235,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
if (!ecma_is_value_object (arguments_list[1]) && !ecma_is_value_null (arguments_list[1]))
{
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);
}
ecma_object_t *obj_p = ecma_get_object_from_value (arguments_list[0]);
@ -258,7 +258,7 @@ ecma_builtin_reflect_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
{
if (!ecma_op_is_callable (arguments_list[0]))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_FUNCTION);
}
ecma_object_t *func_obj_p = ecma_get_object_from_value (arguments_list[0]);

View File

@ -261,7 +261,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this */
#if !JERRY_ESNEXT
if (ecma_get_object_from_value (this_arg) == ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_regexp));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP);
}
#endif /* !JERRY_ESNEXT */
@ -275,7 +275,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this */
{
if (!ecma_is_value_undefined (flags_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument"));
return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT);
}
ecma_extended_object_t *pattern_obj_p = (ecma_extended_object_t *) ecma_get_object_from_value (pattern_arg);
@ -666,7 +666,7 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
if (obj_p == NULL)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
switch (builtin_routine_id)
@ -723,7 +723,7 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
return ecma_make_magic_string_value (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP);
}
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_regexp));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP);
}
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p;
@ -743,7 +743,7 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
return ECMA_VALUE_UNDEFINED;
}
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_regexp));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_REGEXP);
}
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p;

View File

@ -57,7 +57,7 @@ ecma_builtin_regexp_string_iterator_prototype_object_next (ecma_value_t this_val
/* 2. */
if (!ecma_is_value_object (this_val))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@ -65,7 +65,7 @@ ecma_builtin_regexp_string_iterator_prototype_object_next (ecma_value_t this_val
/* 3. */
if (!ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_REGEXP_STRING_ITERATOR))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR);
}
ecma_regexp_string_iterator_t *regexp_string_iterator_obj = (ecma_regexp_string_iterator_t *) obj_p;

View File

@ -152,7 +152,7 @@ ecma_builtin_regexp_dispatch_helper (const ecma_value_t *arguments_list_p, /**<
return ecma_copy_value (pattern_value);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument is passed to RegExp function"));
return ecma_raise_type_error (ECMA_ERR_INVALID_ARGUMENT_IS_PASSED_TO_REGEXP_FUNCTION);
}
#endif /* JERRY_ESNEXT */

View File

@ -47,7 +47,7 @@ ecma_builtin_set_dispatch_call (const ecma_value_t *arguments_list_p, /**< argum
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Set requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_SET_REQUIRES_NEW);
} /* ecma_builtin_set_dispatch_call */
/**

View File

@ -71,7 +71,7 @@ ecma_builtin_shared_arraybuffer_prototype_bytelength_getter (ecma_value_t this_a
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a SharedArrayBuffer object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER);
} /* ecma_builtin_shared_arraybuffer_prototype_bytelength_getter */
/**
@ -90,7 +90,7 @@ ecma_builtin_shared_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /
{
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
@ -98,7 +98,7 @@ ecma_builtin_shared_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /
/* 2. */
if (!ecma_object_class_is (object_p, ECMA_OBJECT_CLASS_SHARED_ARRAY_BUFFER))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an SharedArrayBuffer object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_SHARED_ARRAY_BUFFER_OBJECT);
}
return ecma_builtin_arraybuffer_slice (this_arg, argument_list_p, arguments_number);

View File

@ -58,7 +58,7 @@ ecma_builtin_shared_arraybuffer_dispatch_call (const ecma_value_t *arguments_lis
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor SharedArrayBuffer requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_SHAREDARRAYBUFFER_REQUIRES_NEW);
} /* ecma_builtin_shared_arraybuffer_dispatch_call */
/**

View File

@ -68,7 +68,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
/* 1 - 2. */
if (!ecma_is_value_object (this_val))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@ -77,7 +77,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
/* 3. */
if (!ecma_object_class_is (obj_p, ECMA_OBJECT_CLASS_STRING_ITERATOR))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR);
}
ecma_value_t iterated_value = ext_obj_p->u.cls.u3.iterated_value;

View File

@ -142,7 +142,7 @@ ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a string or a String object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_STRING_OBJECT);
} /* ecma_builtin_string_prototype_object_to_string */
/**
@ -447,7 +447,7 @@ ecma_builtin_string_prototype_object_match_all (ecma_value_t this_argument, /**<
if (!(parsed_flag & RE_FLAG_GLOBAL))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("RegExp argument should have global flag"));
return ecma_raise_type_error (ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG);
}
}
@ -567,7 +567,7 @@ ecma_builtin_string_prototype_object_replace_helper (ecma_value_t this_value, /*
if (!have_global_flag)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("RegExp argument should have global flag"));
return ecma_raise_type_error (ECMA_ERR_REGEXP_ARGUMENT_SHOULD_HAVE_GLOBAL_FLAG);
}
}
}
@ -1258,7 +1258,7 @@ ecma_builtin_string_prototype_object_repeat (ecma_string_t *original_string_p, /
/* 6, 7 */
if (count_number < 0 || (!isNan && ecma_number_is_infinity (count_number)))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid count value"));
return ecma_raise_range_error (ECMA_ERR_INVALID_COUNT_VALUE);
}
lit_utf8_size_t size = ecma_string_get_size (original_string_p);
@ -1270,7 +1270,7 @@ ecma_builtin_string_prototype_object_repeat (ecma_string_t *original_string_p, /
if ((uint32_t) repeat_count >= (ECMA_STRING_SIZE_LIMIT / size))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid string length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_STRING_);
}
lit_utf8_size_t total_size = size * (lit_utf8_size_t) repeat_count;

View File

@ -305,7 +305,7 @@ ecma_builtin_string_object_from_code_point (const ecma_value_t args[], /**< argu
if (!ecma_op_is_integer (to_number_num))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_range_error ("Error: Invalid code point");
return ecma_raise_range_error (ECMA_ERR_INVALID_CODE_POINT_ERROR);
}
ecma_free_value (to_number_value);
@ -313,7 +313,7 @@ ecma_builtin_string_object_from_code_point (const ecma_value_t args[], /**< argu
if (to_number_num < 0 || to_number_num > LIT_UNICODE_CODE_POINT_MAX)
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid code point"));
return ecma_raise_range_error (ECMA_ERR_INVALID_CODE_POINT);
}
lit_code_point_t code_point = (lit_code_point_t) to_number_num;

View File

@ -76,7 +76,7 @@ ecma_builtin_symbol_dispatch_construct (const ecma_value_t *arguments_list_p, /*
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Symbol is not a constructor"));
return ecma_raise_type_error (ECMA_ERR_SYMBOL_IS_NOT_A_CONSTRUCTOR);
} /* ecma_builtin_symbol_dispatch_construct */
/**
@ -241,7 +241,7 @@ ecma_builtin_symbol_key_for (ecma_value_t this_arg, /**< this argument */
/* 1. */
if (!ecma_is_value_symbol (symbol))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The given argument is not a Symbol"));
return ecma_raise_type_error (ECMA_ERR_THE_GIVEN_ARGUMENT_IS_NOT_A_SYMBOL);
}
/* 2-4. */

View File

@ -55,8 +55,7 @@ ecma_builtin_type_error_thrower_dispatch_call (const ecma_value_t *arguments_lis
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("'caller', 'callee', and 'arguments' properties may not be accessed"
" on strict mode functions or the arguments objects for calls to them"));
return ecma_raise_type_error (ECMA_ERR_CANNOT_ACCESS_CALLER_CALLE_ARGUMENTS);
} /* ecma_builtin_type_error_thrower_dispatch_call */
/**

View File

@ -47,7 +47,7 @@ ecma_builtin_weakmap_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor WeakMap requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_WEAKMAP_REQUIRES_NEW);
} /* ecma_builtin_weakmap_dispatch_call */
/**

View File

@ -63,7 +63,7 @@ ecma_builtin_weakref_prototype_object_deref (ecma_value_t this_arg) /**< this ar
{
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error ("Target is not Object");
return ecma_raise_type_error (ECMA_ERR_TARGET_IS_NOT_OBJECT);
}
ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
@ -71,7 +71,7 @@ ecma_builtin_weakref_prototype_object_deref (ecma_value_t this_arg) /**< this ar
if (!ecma_object_class_is (object_p, ECMA_OBJECT_CLASS_WEAKREF))
{
return ecma_raise_type_error ("Target is not weakRef");
return ecma_raise_type_error (ECMA_ERR_TARGET_IS_NOT_WEAKREF);
}
return ecma_copy_value (this_ext_obj->u.cls.u3.target);

View File

@ -50,7 +50,7 @@ ecma_builtin_weakref_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor WeakRef requires 'new'."));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_WEAKREF_REQUIRES_NEW);
} /* ecma_builtin_weakref_dispatch_call */
/**
@ -64,7 +64,7 @@ ecma_builtin_weakref_dispatch_construct (const ecma_value_t *arguments_list_p, /
{
if (arguments_list_len == 0 || !ecma_is_value_object (arguments_list_p[0]))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("WeakRef target must be an object"));
return ecma_raise_type_error (ECMA_ERR_WEAKREF_TARGET_MUST_BE_AN_OBJECT);
}
JERRY_ASSERT (JERRY_CONTEXT (current_new_target_p) != NULL);

View File

@ -47,7 +47,7 @@ ecma_builtin_weakset_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor WeakSet requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_WEAKSET_REQUIRES_NEW);
} /* ecma_builtin_weakset_dispatch_call */
/**

View File

@ -1592,7 +1592,7 @@ ecma_builtin_dispatch_construct (ecma_object_t *obj_p, /**< built-in object */
if (ecma_builtin_function_is_routine (obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Built-in routines have no constructor"));
return ecma_raise_type_error (ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR);
}
ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;

View File

@ -54,7 +54,7 @@ ecma_builtin_bigint64array_dispatch_call (const ecma_value_t *arguments_list_p,
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor BigInt64Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_BIGINT64_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_bigint64array_dispatch_call */
/**

View File

@ -54,7 +54,7 @@ ecma_builtin_biguint64array_dispatch_call (const ecma_value_t *arguments_list_p,
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor BigUInt64Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_BIG_UINT64_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_biguint64array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_float32array_dispatch_call (const ecma_value_t *arguments_list_p, /
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Float32Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_FLOAT32_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_float32array_dispatch_call */
/**

View File

@ -54,7 +54,7 @@ ecma_builtin_float64array_dispatch_call (const ecma_value_t *arguments_list_p, /
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Float64Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_FLOAT64_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_float64array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_int16array_dispatch_call (const ecma_value_t *arguments_list_p, /**
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int16Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_INT16_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_int16array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_int32array_dispatch_call (const ecma_value_t *arguments_list_p, /**
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int32Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_INT32_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_int32array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_int8array_dispatch_call (const ecma_value_t *arguments_list_p, /**<
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int8Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_INT8_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_int8array_dispatch_call */
/**

View File

@ -156,7 +156,7 @@ ecma_builtin_typedarray_prototype_exec_routine (ecma_value_t this_arg, /**< this
if (ecma_arraybuffer_is_detached (info_p->array_buffer_p))
{
ecma_free_value (call_value);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
bool to_bool_result = ecma_op_to_boolean (call_value);
@ -263,7 +263,7 @@ ecma_builtin_typedarray_prototype_map (ecma_value_t this_arg, /**< this object *
{
ecma_free_value (mapped_value);
ecma_free_value (new_typedarray);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
ecma_value_t set_element = target_typedarray_setter_cb (target_buffer_p, mapped_value);
@ -301,7 +301,7 @@ ecma_builtin_typedarray_prototype_reduce_with_direction (ecma_value_t this_arg,
{
if (arguments_number < 2)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined"));
return ecma_raise_type_error (ECMA_ERR_INITIAL_VALUE_CANNOT_BE_UNDEFINED);
}
return ecma_copy_value (arguments_list_p[1]);
@ -368,7 +368,7 @@ ecma_builtin_typedarray_prototype_reduce_with_direction (ecma_value_t this_arg,
if (ecma_arraybuffer_is_detached (info_p->array_buffer_p))
{
ecma_free_value (call_value);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
accumulator = call_value;
@ -448,7 +448,7 @@ ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this objec
{
ecma_free_value (call_value);
ecma_fast_free_value (get_value);
ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
goto cleanup;
}
@ -563,7 +563,7 @@ ecma_op_typedarray_set_with_typedarray (ecma_value_t this_arg, /**< this argumen
if (target_offset_num <= -1.0 || target_offset_num >= (ecma_number_t) UINT32_MAX + 0.5)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset"));
return ecma_raise_range_error (ECMA_ERR_INVALID_OFFSET);
}
ecma_object_t *target_typedarray_p = ecma_get_object_from_value (this_arg);
@ -588,7 +588,7 @@ ecma_op_typedarray_set_with_typedarray (ecma_value_t this_arg, /**< this argumen
if ((int64_t) src_info.length + target_offset_uint32 > target_info.length)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid range of index"));
return ecma_raise_range_error (ECMA_ERR_INVALID_RANGE_OF_INDEX);
}
/* Fast path first. If the source and target arrays are the same we do not need to copy anything. */
@ -663,7 +663,7 @@ ecma_builtin_typedarray_prototype_set (ecma_value_t this_arg, /**< this argument
if (target_offset_num <= -1.0 || target_offset_num >= (ecma_number_t) UINT32_MAX + 0.5)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset"));
return ecma_raise_range_error (ECMA_ERR_INVALID_OFFSET);
}
uint32_t target_offset_uint32 = ecma_number_to_uint32 (target_offset_num);
@ -700,7 +700,7 @@ ecma_builtin_typedarray_prototype_set (ecma_value_t this_arg, /**< this argument
if ((int64_t) source_length + target_offset_uint32 > target_info.length)
{
ecma_deref_object (source_obj_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid range of index"));
return ecma_raise_range_error (ECMA_ERR_INVALID_RANGE_OF_INDEX);
}
JERRY_ASSERT (source_length <= UINT32_MAX);
uint32_t source_length_uint32 = (uint32_t) source_length;
@ -755,7 +755,7 @@ ecma_builtin_typedarray_prototype_set (ecma_value_t this_arg, /**< this argument
{
ecma_deref_object (source_obj_p);
ecma_free_value (value_to_set);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
ecma_value_t set_element = target_typedarray_setter_cb (target_buffer_p, value_to_set);
@ -1142,7 +1142,7 @@ ecma_builtin_typedarray_prototype_sort_compare_helper (ecma_value_t lhs, /**< le
if (ecma_arraybuffer_is_detached (array_buffer_p))
{
ecma_free_value (number_result);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
// If the coerced value can't be represented as a Number, compare them as equals.
@ -1214,7 +1214,7 @@ ecma_builtin_typedarray_prototype_sort (ecma_value_t this_arg, /**< this argumen
if (ecma_arraybuffer_is_detached (info_p->array_buffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
ecma_typedarray_setter_fn_t typedarray_setter_cb = ecma_get_typedarray_setter_fn (info_p->id);
@ -1295,7 +1295,7 @@ ecma_builtin_typedarray_prototype_find_helper (ecma_value_t this_arg, /**< this
{
ecma_free_value (element_value);
ecma_free_value (call_value);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
bool call_result = ecma_op_to_boolean (call_value);
@ -1827,7 +1827,7 @@ ecma_builtin_typedarray_prototype_dispatch_routine (uint8_t builtin_routine_id,
return ECMA_VALUE_UNDEFINED;
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_TYPED_ARRAY);
}
ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
@ -1846,7 +1846,7 @@ ecma_builtin_typedarray_prototype_dispatch_routine (uint8_t builtin_routine_id,
if (builtin_routine_id < ECMA_TYPEDARRAY_PROTOTYPE_ROUTINE_INDEX_OF && !ecma_op_is_callable (arguments_list_p[0]))
{
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);
}
switch (builtin_routine_id)
@ -1913,7 +1913,7 @@ ecma_builtin_typedarray_prototype_dispatch_routine (uint8_t builtin_routine_id,
{
if (!ecma_is_value_undefined (arguments_list_p[0]) && !ecma_op_is_callable (arguments_list_p[0]))
{
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);
}
return ecma_builtin_typedarray_prototype_sort (this_arg, &info, arguments_list_p[0]);

View File

@ -61,7 +61,7 @@ ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
if (!ecma_is_constructor (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a constructor"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR);
}
ecma_value_t source;
@ -70,7 +70,7 @@ ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
if (arguments_list_len == 0)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("No source argument"));
return ecma_raise_type_error (ECMA_ERR_NO_SOURCE_ARGUMENT);
}
source = arguments_list_p[0];
@ -81,7 +81,7 @@ ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
if (!ecma_op_is_callable (map_fn))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The 'mapfn' argument is not callable"));
return ecma_raise_type_error (ECMA_ERR_THE_MAPFN_ARGUMENT_IS_NOT_CALLABLE);
}
if (arguments_list_len > 2)
@ -110,7 +110,7 @@ ecma_builtin_typedarray_of (ecma_value_t this_arg, /**< 'this' argument */
{
if (!ecma_is_constructor (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a constructor"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_CONSTRUCTOR);
}
ecma_object_t *constructor_obj_p = ecma_get_object_from_value (this_arg);
@ -166,7 +166,7 @@ ecma_builtin_typedarray_dispatch_call (const ecma_value_t *arguments_list_p, /**
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray intrinstic cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_TYPEDARRAY_INTRINSTIC_DIRECTLY_CALLED);
} /* ecma_builtin_typedarray_dispatch_call */
/**
@ -183,7 +183,7 @@ ecma_builtin_typedarray_dispatch_construct (const ecma_value_t *arguments_list_p
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray intrinstic cannot be called by a 'new' expression"));
return ecma_raise_type_error (ECMA_ERR_TYPEDARRAY_INTRINSTIC_CALLED_BY_NEW_EXPRESSION);
} /* ecma_builtin_typedarray_dispatch_construct */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_uint16array_dispatch_call (const ecma_value_t *arguments_list_p, /*
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint16Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_UINT16_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_uint16array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_uint32array_dispatch_call (const ecma_value_t *arguments_list_p, /*
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint32Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_UINT32_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_uint32array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_uint8array_dispatch_call (const ecma_value_t *arguments_list_p, /**
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint8Array requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_UINT8_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_uint8array_dispatch_call */
/**

View File

@ -53,7 +53,7 @@ ecma_builtin_uint8clampedarray_dispatch_call (const ecma_value_t *arguments_list
{
JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint8ClampedArray requires 'new'"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_UINT8_CLAMPED_ARRAY_REQUIRES_NEW);
} /* ecma_builtin_uint8clampedarray_dispatch_call */
/**

View File

@ -172,7 +172,7 @@ ecma_op_new_array_object_from_length (ecma_length_t length) /**< length of the n
#if JERRY_ESNEXT
if (length > UINT32_MAX)
{
ecma_raise_range_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
return NULL;
}
#endif /* JERRY_ESNEXT */
@ -757,7 +757,7 @@ ecma_op_array_species_create (ecma_object_t *original_array_p, /**< The object f
if (!ecma_is_constructor (constructor))
{
ecma_free_value (constructor);
ecma_raise_type_error (ECMA_ERR_MSG ("Invalid species constructor"));
ecma_raise_type_error (ECMA_ERR_INVALID_SPECIES_CONSTRUCTOR);
return NULL;
}
@ -997,7 +997,7 @@ ecma_op_array_object_set_length (ecma_object_t *object_p, /**< the array object
if (((ecma_number_t) new_len_uint32) != new_len_num)
{
return ecma_raise_range_error (ECMA_ERR_MSG (ecma_error_invalid_array_length));
return ecma_raise_range_error (ECMA_ERR_INVALID_ARRAY_LENGTH);
}
/* Only the writable and data properties can be modified. */

View File

@ -190,14 +190,14 @@ ecma_arraybuffer_allocate_buffer_throw (ecma_object_t *arraybuffer_p)
if (ECMA_ARRAYBUFFER_GET_FLAGS (arraybuffer_p) & ECMA_ARRAYBUFFER_DETACHED)
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
uint8_t *buffer_p = ecma_arraybuffer_allocate_buffer (arraybuffer_p);
if (buffer_p == NULL)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Cannot allocate memory for ArrayBuffer"));
return ecma_raise_range_error (ECMA_ERR_ALLOCATE_ARRAY_BUFFER);
}
return ECMA_VALUE_UNDEFINED;
@ -290,7 +290,7 @@ ecma_op_create_arraybuffer_object (const ecma_value_t *arguments_list_p, /**< li
if (length_num <= -1.0 || length_num > (ecma_number_t) maximum_size_in_byte + 0.5)
{
ecma_deref_object (proto_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid ArrayBuffer length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_ARRAYBUFFER_LENGTH);
}
}
@ -491,28 +491,28 @@ ecma_builtin_arraybuffer_slice (ecma_value_t this_arg, const ecma_value_t *argum
if (!(ecma_object_class_is (new_arraybuffer_p, ECMA_OBJECT_CLASS_ARRAY_BUFFER)
|| ecma_object_is_shared_arraybuffer (new_arraybuffer_p)))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Return value is not an ArrayBuffer object"));
ret_value = ecma_raise_type_error (ECMA_ERR_RETURN_VALUE_IS_NOT_AN_ARRAYBUFFER_OBJECT);
goto free_new_arraybuffer;
}
/* 14-15. */
if (ECMA_ARRAYBUFFER_CHECK_BUFFER_ERROR (new_arraybuffer_p))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Returned ArrayBuffer has been detached"));
ret_value = ecma_raise_type_error (ECMA_ERR_RETURNED_ARRAYBUFFER_HAS_BEEN_DETACHED);
goto free_new_arraybuffer;
}
/* 16. */
if (new_arraybuffer == this_arg)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer subclass returned this from species constructor"));
ret_value = ecma_raise_type_error (ECMA_ERR_ARRAY_BUFFER_RETURNED_THIS_FROM_CONSTRUCTOR);
goto free_new_arraybuffer;
}
/* 17. */
if (ecma_arraybuffer_get_length (new_arraybuffer_p) < new_len)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Derived ArrayBuffer constructor created a too small buffer"));
ret_value = ecma_raise_type_error (ECMA_ERR_DERIVED_ARRAY_BUFFER_CTOR_BUFFER_TOO_SMALL);
goto free_new_arraybuffer;
}

View File

@ -17,6 +17,7 @@
#include "ecma-alloc.h"
#include "ecma-builtins.h"
#include "ecma-errors.h"
#include "ecma-exceptions.h"
#include "ecma-function-object.h"
#include "ecma-gc.h"
@ -144,7 +145,7 @@ ecma_async_yield_throw (vm_executable_object_t *async_generator_object_p, /**< a
if (result == ECMA_VALUE_UNDEFINED)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'throw' is not available"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE);
}
result = ecma_async_yield_call (result, async_generator_object_p, ECMA_VALUE_EMPTY);
@ -351,7 +352,7 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
if (!ecma_is_value_object (value))
{
ecma_free_value (value);
return ecma_raise_type_error (ECMA_ERR_MSG ("Value received by yield* is not object"));
return ecma_raise_type_error (ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT);
}
ecma_object_t *result_obj_p = ecma_get_object_from_value (value);
@ -432,11 +433,11 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
}
case ECMA_AWAIT_YIELD_CLOSE:
{
const char *msg_p = (ecma_is_value_object (value) ? ECMA_ERR_MSG ("Iterator 'throw' is not available")
: ECMA_ERR_MSG ("Value received by yield* is not object"));
ecma_error_msg_t msg = (ecma_is_value_object (value) ? ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE
: ECMA_ERR_VALUE_RECEIVED_BY_YIELD_IS_NOT_OBJECT);
ecma_free_value (value);
return ecma_raise_type_error (msg_p);
return ecma_raise_type_error (msg);
}
case ECMA_AWAIT_FOR_CLOSE:
{
@ -447,7 +448,7 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
if (!is_value_object
&& VM_GET_CONTEXT_TYPE (executable_object_p->frame_ctx.stack_top_p[-1]) != VM_CONTEXT_FINALLY_THROW)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'return' result is not object"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_RETURN_RESULT_IS_NOT_OBJECT);
}
return ECMA_VALUE_EMPTY;
}
@ -460,7 +461,7 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
if (!ecma_is_value_object (value))
{
ecma_free_value (value);
return ecma_raise_type_error (ECMA_ERR_MSG ("Value received by for-async-of is not object"));
return ecma_raise_type_error (ECMA_ERR_VALUE_RECEIVED_BY_FOR_ASYNC_OF_IS_NOT_OBJECT);
}
ecma_object_t *result_obj_p = ecma_get_object_from_value (value);

View File

@ -53,7 +53,7 @@ ecma_validate_shared_integer_typedarray (ecma_value_t typedarray, /**< typedArra
/* 2. */
if (!ecma_is_value_object (typedarray))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
/* 3-4. */
@ -65,7 +65,7 @@ ecma_validate_shared_integer_typedarray (ecma_value_t typedarray, /**< typedArra
{
if (!(target_info.id == ECMA_BIGINT64_ARRAY || target_info.id == ECMA_INT32_ARRAY))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not supported"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_NOT_SUPPORTED);
}
}
else
@ -73,7 +73,7 @@ ecma_validate_shared_integer_typedarray (ecma_value_t typedarray, /**< typedArra
if (target_info.id == ECMA_UINT8_CLAMPED_ARRAY || target_info.id == ECMA_FLOAT32_ARRAY
|| target_info.id == ECMA_FLOAT64_ARRAY)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not supported"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_NOT_SUPPORTED);
}
}
@ -85,7 +85,7 @@ ecma_validate_shared_integer_typedarray (ecma_value_t typedarray, /**< typedArra
if (!ecma_object_class_is (buffer, ECMA_OBJECT_CLASS_SHARED_ARRAY_BUFFER))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not SharedArrayBuffer"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_NOT_SHARED_ARRAY_BUFFER);
}
return ecma_make_object_value (buffer);
@ -124,7 +124,7 @@ ecma_validate_atomic_access (ecma_value_t typedarray, /**< typedArray argument *
/* 5-6. */
if (JERRY_UNLIKELY (access_index >= target_info.length))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_LENGTH);
}
return ecma_make_number_value (access_index);

View File

@ -33,7 +33,7 @@
static ecma_value_t
ecma_bigint_raise_memory_error (void)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Cannot allocate memory for a BigInt value"));
return ecma_raise_range_error (ECMA_ERR_ALLOCATE_BIGINT_VALUE);
} /* ecma_bigint_raise_memory_error */
/**
@ -172,7 +172,7 @@ ecma_bigint_parse_string (const lit_utf8_byte_t *string_p, /**< string represena
{
return ECMA_VALUE_FALSE;
}
return ecma_raise_syntax_error (ECMA_ERR_MSG ("String cannot be converted to BigInt value"));
return ecma_raise_syntax_error (ECMA_ERR_STRING_CANNOT_BE_CONVERTED_TO_BIGINT_VALUE);
}
result_p = ecma_big_uint_mul_digit (result_p, radix, digit);
@ -239,7 +239,7 @@ ecma_bigint_to_string (ecma_value_t value, /**< BigInt value */
if (JERRY_UNLIKELY (string_buffer_p == NULL))
{
ecma_raise_range_error (ECMA_ERR_MSG ("Cannot allocate memory for a string representation of a BigInt value"));
ecma_raise_range_error (ECMA_ERR_ALLOCATE_BIGINT_STRING);
return NULL;
}
@ -382,7 +382,7 @@ ecma_bigint_number_to_bigint (ecma_number_t number) /**< ecma number */
{
if (ecma_number_is_nan (number) || ecma_number_is_infinity (number))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Infinity or NaN cannot be converted to BigInt"));
return ecma_raise_range_error (ECMA_ERR_INFINITY_OR_NAN_CANNOT_BE_CONVERTED_TO_BIGINT);
}
ecma_bigint_digit_t digits[3];
@ -393,7 +393,7 @@ ecma_bigint_number_to_bigint (ecma_number_t number) /**< ecma number */
if (result & ECMA_BIGINT_NUMBER_TO_DIGITS_HAS_FRACTION)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Only integer numbers can be converted to BigInt"));
return ecma_raise_range_error (ECMA_ERR_ONLY_INTEGER_NUMBERS_CAN_BE_CONVERTED_TO_BIGINT);
}
uint32_t digits_size = ECMA_BIGINT_NUMBER_TO_DIGITS_GET_DIGITS_SIZE (result);
@ -483,7 +483,7 @@ ecma_bigint_to_bigint (ecma_value_t value, /**< any value */
}
else
{
result = ecma_raise_type_error (ECMA_ERR_MSG ("Value cannot be converted to BigInt"));
result = ecma_raise_type_error (ECMA_ERR_VALUE_CANNOT_BE_CONVERTED_TO_BIGINT);
}
if (free_value)
@ -665,7 +665,7 @@ ecma_bigint_get_bigint (ecma_value_t value, /**< any value */
ecma_free_value (default_value);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a BigInt value to a number"));
return ecma_raise_type_error (ECMA_ERR_CONVERT_BIGINT_TO_NUMBER);
} /* ecma_bigint_get_bigint */
/**
@ -1306,7 +1306,7 @@ ecma_bigint_div_mod (ecma_value_t left_value, /**< left BigInt value */
if (right_value == ECMA_BIGINT_ZERO)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("BigInt division by zero"));
return ecma_raise_range_error (ECMA_ERR_BIGINT_ZERO_DIVISION);
}
if (left_value == ECMA_BIGINT_ZERO)
@ -1473,7 +1473,7 @@ ecma_bigint_pow (ecma_value_t left_value, /**< left BigInt value */
if (right_p->u.bigint_sign_and_size & ECMA_BIGINT_SIGN)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Negative exponent is not allowed for BigInts"));
return ecma_raise_range_error (ECMA_ERR_NEGATIVE_EXPONENT_IS_NOT_ALLOWED_FOR_BIGINTS);
}
if (left_value == ECMA_BIGINT_ZERO)

View File

@ -415,7 +415,7 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
if (!ecma_op_is_callable (result))
{
ecma_free_value (result);
result = ecma_raise_type_error (ECMA_ERR_MSG ("Function add/set is not callable"));
result = ecma_raise_type_error (ECMA_ERR_FUNCTION_ADD_ORSET_IS_NOT_CALLABLE);
goto cleanup_object;
}
@ -468,7 +468,7 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
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 (iterator);
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (result));
goto cleanup_iterator;
@ -560,7 +560,7 @@ ecma_op_container_get_object (ecma_value_t this_arg, /**< this argument */
"Expected a % object",
ecma_make_string_value (ecma_get_magic_string (lit_id)));
#else /* !JERRY_ERROR_MESSAGES */
ecma_raise_type_error (NULL);
ecma_raise_type_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
return NULL;
@ -681,7 +681,7 @@ ecma_op_container_set (ecma_extended_object_t *map_object_p, /**< map object */
if ((map_object_p->u.cls.u1.container_flags & ECMA_CONTAINER_FLAGS_WEAK) != 0 && !ecma_is_value_object (key_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Key must be an object"));
return ecma_raise_type_error (ECMA_ERR_KEY_MUST_BE_AN_OBJECT);
}
ecma_value_t *entry_p = ecma_op_internal_buffer_find (container_p, key_arg, lit_id);
@ -720,7 +720,7 @@ ecma_op_container_foreach (ecma_extended_object_t *map_object_p, /**< map object
{
if (!ecma_op_is_callable (predicate))
{
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);
}
JERRY_ASSERT (ecma_is_value_object (predicate));
@ -972,7 +972,7 @@ ecma_op_container_iterator_next (ecma_value_t this_val, /**< this argument */
{
if (!ecma_is_value_object (this_val))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@ -980,7 +980,7 @@ ecma_op_container_iterator_next (ecma_value_t this_val, /**< this argument */
if (!ecma_object_class_is (obj_p, iterator_type))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_ITERATOR);
}
ecma_value_t iterated_value = ext_obj_p->u.cls.u3.iterated_value;

View File

@ -61,7 +61,7 @@ ecma_op_require_object_coercible (ecma_value_t value) /**< ecma value */
if (ecma_is_value_undefined (value) || ecma_is_value_null (value))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Argument cannot be converted to an object"));
ecma_raise_type_error (ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT);
return false;
}
@ -339,7 +339,7 @@ ecma_op_to_numeric (ecma_value_t value, /**< ecma value */
#if JERRY_ESNEXT
if (ecma_is_value_symbol (value))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a number"));
return ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_NUMBER);
}
#endif /* JERRY_ESNEXT */
@ -350,7 +350,7 @@ ecma_op_to_numeric (ecma_value_t value, /**< ecma value */
{
return ecma_copy_value (value);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a BigInt value to a number"));
return ecma_raise_type_error (ECMA_ERR_CONVERT_BIGINT_TO_NUMBER);
}
#endif /* JERRY_BUILTIN_BIGINT */
@ -436,7 +436,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */
#if JERRY_ESNEXT
if (ecma_is_value_symbol (value))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a string"));
ecma_raise_type_error (ECMA_ERR_CONVERT_SYMBOL_TO_STRING);
return NULL;
}
#endif /* JERRY_ESNEXT */
@ -564,7 +564,7 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */
{
if (ecma_is_value_undefined (value) || ecma_is_value_null (value))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument cannot be converted to an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_CANNOT_CONVERT_TO_OBJECT);
}
else
{
@ -695,7 +695,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
/* 1. */
if (!ecma_is_value_object (obj_value))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected an object"));
return ecma_raise_type_error (ECMA_ERR_EXPECTED_AN_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
@ -786,7 +786,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
if (!ecma_op_is_callable (get_prop_value) && !ecma_is_value_undefined (get_prop_value))
{
ecma_free_value (get_prop_value);
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_expected_a_function));
ret_value = ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION);
goto free_desc;
}
@ -822,7 +822,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
if (!ecma_op_is_callable (set_prop_value) && !ecma_is_value_undefined (set_prop_value))
{
ecma_free_value (set_prop_value);
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_expected_a_function));
ret_value = ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION);
goto free_desc;
}
@ -849,7 +849,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
if ((prop_desc.flags & (JERRY_PROP_IS_VALUE_DEFINED | JERRY_PROP_IS_WRITABLE_DEFINED))
&& (prop_desc.flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED)))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Accessors cannot be writable"));
ret_value = ecma_raise_type_error (ECMA_ERR_ACCESSOR_WRITABLE);
}
else
{
@ -1035,7 +1035,7 @@ ecma_op_to_index (ecma_value_t value, /**< ecma value */
/* 2.b - 2.d */
if (integer_index < 0.0f || integer_index > ECMA_NUMBER_MAX_SAFE_INTEGER)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid or out-of-range index"));
return ecma_raise_range_error (ECMA_ERR_INVALID_OR_OUT_OF_RANGE_INDEX);
}
/* 3. */
@ -1064,7 +1064,7 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */
/* 3. */
if (!ecma_is_value_object (arr))
{
ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_argument_is_not_an_object));
ecma_raise_type_error (ECMA_ERR_ARGUMENT_IS_NOT_AN_OBJECT);
return NULL;
}
ecma_object_t *obj_p = ecma_get_object_from_value (arr);
@ -1093,7 +1093,7 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */
{
ecma_free_value (next);
ecma_collection_free (list_ptr);
ecma_raise_type_error (ECMA_ERR_MSG ("Property name is neither Symbol nor string"));
ecma_raise_type_error (ECMA_ERR_PROPERTY_NAME_IS_NEITHER_SYMBOL_NOR_STRING);
return NULL;
}

View File

@ -58,7 +58,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
/* 2. */
if (!ecma_is_value_object (buffer))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'buffer' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_BUFFER_NOT_OBJECT);
}
ecma_object_t *buffer_p = ecma_get_object_from_value (buffer);
@ -66,7 +66,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
if (!(ecma_object_class_is (buffer_p, ECMA_OBJECT_CLASS_ARRAY_BUFFER)
|| ecma_object_is_shared_arraybuffer (buffer_p)))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'buffer' is not an ArrayBuffer or SharedArrayBuffer"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_BUFFER_NOT_ARRAY_OR_SHARED_BUFFER);
}
/* 3. */
@ -84,7 +84,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
/* 4. */
if (ecma_arraybuffer_is_detached (buffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
/* 5. */
@ -93,7 +93,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
/* 6. */
if (offset > buffer_byte_length)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Start offset is outside the bounds of the buffer"));
return ecma_raise_range_error (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER);
}
/* 7. */
@ -112,7 +112,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
/* 8.b */
if (offset + byte_length_to_index > buffer_byte_length)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Start offset is outside the bounds of the buffer"));
return ecma_raise_range_error (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER);
}
JERRY_ASSERT (byte_length_to_index <= UINT32_MAX);
@ -136,7 +136,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
if (ecma_arraybuffer_is_detached (buffer_p))
{
ecma_deref_object (prototype_obj_p);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
/* 9. */
@ -179,7 +179,7 @@ ecma_op_dataview_get_object (ecma_value_t this_arg) /**< this argument */
}
}
ecma_raise_type_error (ECMA_ERR_MSG ("Expected a DataView object"));
ecma_raise_type_error (ECMA_ERR_EXPECTED_A_DATAVIEW_OBJECT);
return NULL;
} /* ecma_op_dataview_get_object */
@ -317,7 +317,7 @@ ecma_op_dataview_get_set_view_value (ecma_value_t view, /**< the operation's 'vi
if (get_index + element_size > (ecma_number_t) view_size)
{
ecma_free_value (value_to_set);
return ecma_raise_range_error (ECMA_ERR_MSG ("Start offset is outside the bounds of the buffer"));
return ecma_raise_range_error (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER);
}
if (ECMA_ARRAYBUFFER_CHECK_BUFFER_ERROR (buffer_p))

View File

@ -98,7 +98,7 @@ ecma_op_eval_chars_buffer (void *source_p, /**< source code */
JERRY_UNUSED (code_buffer_size);
JERRY_UNUSED (parse_opts);
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
return ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED);
#endif /* JERRY_PARSER */
} /* ecma_op_eval_chars_buffer */

View File

@ -298,7 +298,7 @@ ecma_get_error_type (ecma_object_t *error_object_p) /**< possible error object *
* @return ecma value
* Returned value must be freed with ecma_free_value
*/
static ecma_value_t
ecma_value_t
ecma_raise_standard_error (jerry_error_t error_type, /**< error type */
const lit_utf8_byte_t *msg_p) /**< error message */
{
@ -414,9 +414,9 @@ ecma_raise_standard_error_with_format (jerry_error_t error_type, /**< error type
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_common_error (const char *msg_p) /**< error message */
ecma_raise_common_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_COMMON, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_COMMON, ecma_get_error_utf8 (msg));
} /* ecma_raise_common_error */
/**
@ -428,9 +428,9 @@ ecma_raise_common_error (const char *msg_p) /**< error message */
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_range_error (const char *msg_p) /**< error message */
ecma_raise_range_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_RANGE, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_RANGE, ecma_get_error_utf8 (msg));
} /* ecma_raise_range_error */
/**
@ -442,9 +442,9 @@ ecma_raise_range_error (const char *msg_p) /**< error message */
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_reference_error (const char *msg_p) /**< error message */
ecma_raise_reference_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_REFERENCE, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_REFERENCE, ecma_get_error_utf8 (msg));
} /* ecma_raise_reference_error */
/**
@ -456,9 +456,9 @@ ecma_raise_reference_error (const char *msg_p) /**< error message */
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_syntax_error (const char *msg_p) /**< error message */
ecma_raise_syntax_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_SYNTAX, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_SYNTAX, ecma_get_error_utf8 (msg));
} /* ecma_raise_syntax_error */
/**
@ -470,9 +470,9 @@ ecma_raise_syntax_error (const char *msg_p) /**< error message */
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_type_error (const char *msg_p) /**< error message */
ecma_raise_type_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_TYPE, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_TYPE, ecma_get_error_utf8 (msg));
} /* ecma_raise_type_error */
/**
@ -484,11 +484,25 @@ ecma_raise_type_error (const char *msg_p) /**< error message */
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_uri_error (const char *msg_p) /**< error message */
ecma_raise_uri_error (ecma_error_msg_t msg) /**< error message */
{
return ecma_raise_standard_error (JERRY_ERROR_URI, (const lit_utf8_byte_t *) msg_p);
return ecma_raise_standard_error (JERRY_ERROR_URI, ecma_get_error_utf8 (msg));
} /* ecma_raise_uri_error */
#if (JERRY_STACK_LIMIT != 0)
/**
* Raise a RangeError with "Maximum call stack size exceeded" message.
*
* @return ecma value
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
ecma_raise_maximum_callstack_error (void)
{
return ecma_raise_range_error (ECMA_ERR_MAXIMUM_CALL_STACK_SIZE_EXCEEDED);
} /* ecma_raise_maximum_callstack_error */
#endif /* (JERRY_STACK_LIMIT != 0) */
#if JERRY_ESNEXT
/**

View File

@ -27,23 +27,21 @@
* @{
*/
#if JERRY_ERROR_MESSAGES
#define ECMA_ERR_MSG(msg) msg
#else /* !JERRY_ERROR_MESSAGES */
#define ECMA_ERR_MSG(msg) NULL
#endif /* JERRY_ERROR_MESSAGES */
jerry_error_t ecma_get_error_type (ecma_object_t *error_object_p);
ecma_object_t *ecma_new_standard_error (jerry_error_t error_type, ecma_string_t *message_string_p);
#if JERRY_ERROR_MESSAGES
ecma_value_t ecma_raise_standard_error_with_format (jerry_error_t error_type, const char *msg_p, ...);
#endif /* JERRY_ERROR_MESSAGES */
ecma_value_t ecma_raise_common_error (const char *msg_p);
ecma_value_t ecma_raise_range_error (const char *msg_p);
ecma_value_t ecma_raise_reference_error (const char *msg_p);
ecma_value_t ecma_raise_syntax_error (const char *msg_p);
ecma_value_t ecma_raise_type_error (const char *msg_p);
ecma_value_t ecma_raise_uri_error (const char *msg_p);
ecma_value_t ecma_raise_standard_error (jerry_error_t error_type, const lit_utf8_byte_t *msg_p);
ecma_value_t ecma_raise_common_error (ecma_error_msg_t msg);
ecma_value_t ecma_raise_range_error (ecma_error_msg_t msg);
ecma_value_t ecma_raise_reference_error (ecma_error_msg_t msg);
ecma_value_t ecma_raise_syntax_error (ecma_error_msg_t msg);
ecma_value_t ecma_raise_type_error (ecma_error_msg_t msg);
ecma_value_t ecma_raise_uri_error (ecma_error_msg_t msg);
#if (JERRY_STACK_LIMIT != 0)
ecma_value_t ecma_raise_maximum_callstack_error (void);
#endif /* (JERRY_STACK_LIMIT != 0) */
#if JERRY_ESNEXT
ecma_value_t ecma_new_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val);
ecma_value_t ecma_raise_aggregate_error (ecma_value_t error_list_val, ecma_value_t message_val);

View File

@ -18,6 +18,7 @@
#include "ecma-alloc.h"
#include "ecma-builtin-handlers.h"
#include "ecma-builtin-helpers.h"
#include "ecma-errors.h"
#include "ecma-exceptions.h"
#include "ecma-extended-info.h"
#include "ecma-gc.h"
@ -153,9 +154,9 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma value */
*
*
* @return ECMA_IS_VALID_CONSTRUCTOR - if object is a valid for constructor call
* any other value - if object is not a valid constructor, the pointer contains the error message.
* ecma_error_msg_t id of error - otherwise
*/
char *
ecma_error_msg_t
ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
{
JERRY_ASSERT (!ecma_is_lexical_environment (obj_p));
@ -164,7 +165,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
if (JERRY_UNLIKELY (type < ECMA_OBJECT_TYPE_PROXY))
{
return ECMA_ERR_MSG ("Invalid type for constructor call");
return ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL;
}
while (JERRY_UNLIKELY (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION))
@ -189,40 +190,40 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
{
case CBC_FUNCTION_SCRIPT:
{
return "Script (global) functions cannot be invoked with 'new'";
return ECMA_ERR_SCRIPT_GLOBAL_FUNCTIONS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_GENERATOR:
{
return "Generator functions cannot be invoked with 'new'";
return ECMA_ERR_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_ASYNC:
{
return "Async functions cannot be invoked with 'new'";
return ECMA_ERR_ASYNC_FUNCTIONS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_ASYNC_GENERATOR:
{
return "Async generator functions cannot be invoked with 'new'";
return ECMA_ERR_ASYNC_GENERATOR_FUNCTIONS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_ACCESSOR:
{
return "Accessor functions cannot be invoked with 'new'";
return ECMA_ERR_ACCESSOR_FUNCTIONS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_METHOD:
{
return "Methods cannot be invoked with 'new'";
return ECMA_ERR_METHODS_INVOKE_WITH_NEW;
}
case CBC_FUNCTION_ARROW:
{
return "Arrow functions cannot be invoked with 'new'";
return ECMA_ERR_ARROW_FUNCTIONS_INVOKE_WITH_NEW;
}
default:
{
JERRY_ASSERT (CBC_FUNCTION_GET_TYPE (byte_code_p->status_flags) == CBC_FUNCTION_ASYNC_ARROW);
return "Async arrow functions cannot be invoked with 'new'";
return ECMA_ERR_ASYNC_ARROW_FUNCTIONS_INVOKE_WITH_NEW;
}
}
#else /* !JERRY_ERROR_MESSAGES */
return NULL;
return ECMA_ERR_EMPTY;
#endif /* JERRY_ERROR_MESSAGES */
}
#endif /* JERRY_NEXT */
@ -235,7 +236,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
{
if (!(obj_p->u2.prototype_cp & ECMA_PROXY_IS_CONSTRUCTABLE))
{
return ECMA_ERR_MSG ("Proxy target is not a constructor");
return ECMA_ERR_PROXY_TARGET_IS_NOT_A_CONSTRUCTOR;
}
return ECMA_IS_VALID_CONSTRUCTOR;
@ -249,7 +250,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
{
if (ecma_builtin_function_is_routine (obj_p))
{
return ECMA_ERR_MSG ("Built-in routines have no constructor");
return ECMA_ERR_BULTIN_ROUTINES_HAVE_NO_CONSTRUCTOR;
}
#if JERRY_ESNEXT
@ -264,14 +265,14 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
* Implement IsConstructor abstract operation.
*
* @return ECMA_IS_VALID_CONSTRUCTOR - if the input value is a constructor.
* any other value - if the input value is not a valid constructor, the pointer contains the error message.
* ecma_error_msg_t id of error - otherwise
*/
extern inline char *JERRY_ATTR_ALWAYS_INLINE
extern inline ecma_error_msg_t JERRY_ATTR_ALWAYS_INLINE
ecma_check_constructor (ecma_value_t value) /**< ecma object */
{
if (!ecma_is_value_object (value))
{
return ECMA_ERR_MSG ("Invalid type for constructor call");
return ECMA_ERR_INVALID_TYPE_FOR_CONSTRUCTOR_CALL;
}
return ecma_object_check_constructor (ecma_get_object_from_value (value));
@ -824,7 +825,7 @@ ecma_op_function_get_function_realm (ecma_object_t *func_obj_p) /**< function ob
ecma_proxy_object_t *proxy_obj_p = (ecma_proxy_object_t *) func_obj_p;
if (ecma_is_value_null (proxy_obj_p->handler))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Prototype from revoked Proxy is invalid"));
ecma_raise_type_error (ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID);
return NULL;
}
func_obj_p = ecma_get_object_from_value (proxy_obj_p->target);
@ -888,7 +889,7 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
if (!ecma_is_value_object (prototype_obj_value))
{
ecma_free_value (prototype_obj_value);
return ecma_raise_type_error (ECMA_ERR_MSG ("Object expected"));
return ecma_raise_type_error (ECMA_ERR_OBJECT_EXPECTED);
}
ecma_object_t *prototype_obj_p = ecma_get_object_from_value (prototype_obj_value);
@ -959,7 +960,7 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
{
ecma_deref_object (super_ctor_p);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Super binding must be a constructor"));
return ecma_raise_type_error (ECMA_ERR_SUPER_BINDING_MUST_BE_A_CONSTRUCTOR);
}
return ecma_make_object_value (super_ctor_p);
@ -1002,7 +1003,7 @@ ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, /**< construc
ecma_proxy_object_t *proxy_obj_p = (ecma_proxy_object_t *) ctor_obj_p;
if (ecma_is_value_null (proxy_obj_p->handler))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Prototype from revoked Proxy is invalid"));
ecma_raise_type_error (ECMA_ERR_PROTOTYPE_FROM_REVOKED_PROXY_IS_INVALID);
return NULL;
}
}
@ -1042,7 +1043,7 @@ ecma_op_function_call_constructor (vm_frame_ctx_shared_args_t *shared_args_p, /*
if (JERRY_CONTEXT (current_new_target_p) == NULL)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor requires 'new'"));
ret_value = ecma_raise_type_error (ECMA_ERR_CLASS_CONSTRUCTOR_REQUIRES_NEW);
goto exit;
}
@ -1073,7 +1074,7 @@ ecma_op_function_call_constructor (vm_frame_ctx_shared_args_t *shared_args_p, /*
if (!ecma_is_value_undefined (ret_value))
{
ecma_free_value (ret_value);
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Derived constructors may only return object or undefined"));
ret_value = ecma_raise_type_error (ECMA_ERR_DERIVED_CTOR_RETURN_NOR_OBJECT_OR_UNDEFINED);
}
else
{
@ -1395,7 +1396,7 @@ ecma_op_function_validated_call (ecma_value_t callee, /**< callee */
{
if (!ecma_is_value_object (callee))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_expected_a_function));
return ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION);
}
return ecma_op_function_call (ecma_get_object_from_value (callee),
@ -1453,7 +1454,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
#if JERRY_ESNEXT
case ECMA_OBJECT_TYPE_CONSTRUCTOR_FUNCTION:
{
result = ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_class_constructor_new));
result = ecma_raise_type_error (ECMA_ERR_CLASS_CONSTRUCTOR_NEW);
break;
}
#endif /* JERRY_ESNEXT */
@ -1469,7 +1470,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
}
default:
{
result = ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_expected_a_function));
result = ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION);
break;
}
}

View File

@ -46,10 +46,9 @@ bool ecma_object_is_constructor (ecma_object_t *obj_p);
*
* Use after the ecma_*_check_constructor calls.
*/
#define ECMA_IS_VALID_CONSTRUCTOR ((char *) 0x1)
char *ecma_object_check_constructor (ecma_object_t *obj_p);
char *ecma_check_constructor (ecma_value_t value);
ecma_error_msg_t ecma_object_check_constructor (ecma_object_t *obj_p);
ecma_error_msg_t ecma_check_constructor (ecma_value_t value);
ecma_object_t *ecma_op_create_simple_function_object (ecma_object_t *scope_p,
const ecma_compiled_code_t *bytecode_data_p);

View File

@ -65,7 +65,7 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
#endif /* JERRY_ESNEXT */
@ -93,7 +93,7 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
return ecma_fast_copy_value (property_value_p->value);
@ -134,7 +134,7 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
"% is not defined",
ecma_make_string_value (name_p));
#else /* JERRY_ERROR_MESSAGES */
return ecma_raise_reference_error (NULL);
return ecma_raise_reference_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
} /* ecma_op_get_value_lex_env_base */
@ -322,7 +322,7 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
"% is not defined",
ecma_make_string_value (name_p));
#else /* !JERRY_ERROR_MESSAGES */
return ecma_raise_reference_error (NULL);
return ecma_raise_reference_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
}

View File

@ -259,7 +259,7 @@ ecma_op_get_iterator (ecma_value_t value, /**< value to get iterator from */
if (!ecma_is_value_object (iterator))
{
ecma_free_value (iterator);
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator is not an object"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_IS_NOT_AN_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (iterator);
@ -305,7 +305,7 @@ ecma_op_iterator_next (ecma_value_t iterator, /**< iterator value */
/* 1 - 2. */
if (next_method == ECMA_VALUE_UNDEFINED)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'next' is not callable"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_NEXT_IS_NOT_CALLABLE);
}
ecma_object_t *next_method_obj_p = ecma_get_object_from_value (next_method);
@ -391,7 +391,7 @@ ecma_op_iterator_throw (ecma_value_t iterator, /**< iterator value */
}
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'throw' is not available"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_THROW_IS_NOT_AVAILABLE);
}
ecma_value_t result = ecma_op_function_validated_call (func_throw, iterator, &value, 1);
@ -530,7 +530,7 @@ ecma_op_iterator_close (ecma_value_t iterator) /**< iterator value */
if (!is_object)
{
ecma_free_value (completion);
return ecma_raise_type_error (ECMA_ERR_MSG ("method 'return' is not callable"));
return ecma_raise_type_error (ECMA_ERR_METHOD_RETURN_IS_NOT_CALLABLE);
}
/* 10. */
@ -570,7 +570,7 @@ ecma_op_iterator_step (ecma_value_t iterator, /**< iterator value */
if (!ecma_is_value_object (result))
{
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator result is not an object"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT);
}
/* 3. */
@ -638,7 +638,7 @@ ecma_op_iterator_do (ecma_iterator_command_type_t command, /**< command to be ex
if (!ecma_is_value_object (result))
{
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator result is not an object"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_RESULT_IS_NOT_AN_OBJECT);
}
ecma_object_t *obj_p = ecma_get_object_from_value (result);

View File

@ -110,18 +110,18 @@ ecma_op_raise_set_binding_error (ecma_property_t *property_p, /**< property */
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
JERRY_ASSERT (!ecma_is_property_writable (*property_p));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned"));
return ecma_raise_type_error (ECMA_ERR_CONSTANT_BINDINGS_CANNOT_BE_REASSIGNED);
}
#endif /* JERRY_ESNEXT */
if (is_strict)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set"));
return ecma_raise_type_error (ECMA_ERR_BINDING_CANNOT_SET);
}
return ECMA_VALUE_EMPTY;
} /* ecma_op_raise_set_binding_error */
@ -387,7 +387,7 @@ ecma_op_get_binding_value (ecma_object_t *lex_env_p, /**< lexical environment */
{
if (is_strict)
{
result = ecma_raise_reference_error (ECMA_ERR_MSG ("Binding does not exist or is uninitialised"));
result = ecma_raise_reference_error (ECMA_ERR_BINDING_NOT_EXIST_OR_UNINITIALIZED);
}
else
{
@ -636,8 +636,7 @@ ecma_op_get_this_binding (ecma_object_t *lex_env_p) /**< lexical environment */
if (this_value == ECMA_VALUE_UNINITIALIZED)
{
return ecma_raise_reference_error (ECMA_ERR_MSG ("Must call super constructor in derived class before "
"accessing 'this' or returning from it"));
return ecma_raise_reference_error (ECMA_ERR_CALL_SUPER_CONSTRUCTOR_DERIVED_CLASS_BEFORE_THIS);
}
ecma_ref_object (ecma_get_object_from_value (this_value));

View File

@ -112,7 +112,7 @@ ecma_op_general_object_delete (ecma_object_t *obj_p, /**< the object */
/* 4. */
if (is_throw)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a configurable property"));
return ecma_raise_type_error (ECMA_ERR_EXPECTED_A_CONFIGURABLE_PROPERTY);
}
/* 5. */
@ -258,7 +258,7 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Result of [[DefaultValue]] is invalid"));
return ecma_raise_type_error (ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID);
}
ecma_free_value (exotic_to_prim);
@ -330,7 +330,7 @@ ecma_op_general_object_ordinary_value (ecma_object_t *obj_p, /**< the object */
ecma_free_value (call_completion);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Result of [[DefaultValue]] is invalid"));
return ecma_raise_type_error (ECMA_ERR_RESULT_OF_DEFAULTVALUE_IS_INVALID);
} /* ecma_op_general_object_ordinary_value */
/**
@ -475,7 +475,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
{
if (JERRY_UNLIKELY (ext_property_ref.property_ref.virtual_value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
if (property_desc_p->flags & JERRY_PROP_IS_WRITABLE_DEFINED)

View File

@ -614,7 +614,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
if (JERRY_UNLIKELY (prop_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
}
@ -1096,7 +1096,7 @@ ecma_op_get_method (ecma_value_t value, /**< ecma value */
if (!ecma_op_is_callable (func))
{
ecma_free_value (func);
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator is not callable"));
return ecma_raise_type_error (ECMA_ERR_ITERATOR_IS_NOT_CALLABLE);
}
/* 6. */
@ -1219,7 +1219,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
/* 5.b */
if (!ecma_is_value_object (receiver))
{
return ECMA_REJECT (is_throw, "Receiver must be an object");
return ECMA_REJECT (is_throw, ECMA_ERR_RECEIVER_MUST_BE_AN_OBJECT);
}
ecma_object_t *receiver_obj_p = ecma_get_object_from_value (receiver);
@ -1257,7 +1257,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
if (JERRY_UNLIKELY (ecma_is_value_false (result)))
{
result = ECMA_REJECT (is_throw, "Proxy trap returned falsish");
result = ECMA_REJECT (is_throw, ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH);
}
}
@ -1279,7 +1279,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
if (JERRY_UNLIKELY (ecma_is_value_false (ret_value)))
{
ret_value = ECMA_REJECT (is_throw, "Proxy trap returned falsish");
ret_value = ECMA_REJECT (is_throw, ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH);
}
return ret_value;
@ -1906,7 +1906,7 @@ ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, /**< the ob
#if JERRY_MODULE_SYSTEM
if (JERRY_UNLIKELY (property_ref.virtual_value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
#endif /* JERRY_MODULE_SYSTEM */
prop_desc_p->value = property_ref.virtual_value;
@ -1990,7 +1990,7 @@ ecma_op_object_has_instance (ecma_object_t *obj_p, /**< the object */
return ecma_op_function_has_instance (obj_p, value);
}
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function object"));
return ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION_OBJECT);
} /* ecma_op_object_has_instance */
/**
@ -3131,7 +3131,7 @@ ecma_op_species_constructor (ecma_object_t *this_value, /**< This Value */
if (!ecma_is_value_object (constructor))
{
ecma_free_value (constructor);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor must be an object"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTOR_NOT_AN_OBJECT);
}
ecma_object_t *ctor_object_p = ecma_get_object_from_value (constructor);
@ -3152,7 +3152,7 @@ ecma_op_species_constructor (ecma_object_t *this_value, /**< This Value */
if (!ecma_is_constructor (species))
{
ecma_free_value (species);
return ecma_raise_type_error (ECMA_ERR_MSG ("Species must be a constructor"));
return ecma_raise_type_error (ECMA_ERR_SPECIES_MUST_BE_A_CONSTRUCTOR);
}
return species;

View File

@ -47,7 +47,7 @@
/**
* Reject with TypeError depending on is_throw flags wit the given message
*/
#define ECMA_REJECT(is_throw, msg) ((is_throw) ? ecma_raise_type_error (NULL) : ECMA_VALUE_FALSE)
#define ECMA_REJECT(is_throw, msg) ((is_throw) ? ecma_raise_type_error (ECMA_ERR_EMPTY) : ECMA_VALUE_FALSE)
#endif /* JERRY_ERROR_MESSAGES */
ecma_value_t ecma_raise_property_redefinition (ecma_string_t *property_name_p, uint16_t flags);

View File

@ -250,7 +250,7 @@ ecma_fulfill_promise (ecma_value_t promise, /**< promise */
if (promise == value)
{
ecma_raise_type_error (ECMA_ERR_MSG ("A promise cannot be resolved with itself"));
ecma_raise_type_error (ECMA_ERR_PROMISE_RESOLVE_ITSELF);
ecma_value_t exception = jcontext_take_exception ();
ecma_reject_promise (promise, exception);
ecma_free_value (exception);
@ -699,13 +699,13 @@ ecma_op_get_capabilities_executor_cb (ecma_object_t *function_obj_p, /**< functi
/* 4. */
if (!ecma_is_value_undefined (capability_p->resolve))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Resolve must be undefined"));
return ecma_raise_type_error (ECMA_ERR_RESOLVE_MUST_BE_UNDEFINED);
}
/* 5. */
if (!ecma_is_value_undefined (capability_p->reject))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Reject must be undefined"));
return ecma_raise_type_error (ECMA_ERR_REJECT_MUST_BE_UNDEFINED);
}
/* 6. */
@ -732,7 +732,7 @@ ecma_promise_new_capability (ecma_value_t constructor, /**< constructor function
/* 1. */
if (!ecma_is_constructor (constructor))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Invalid capability"));
ecma_raise_type_error (ECMA_ERR_INVALID_CAPABILITY);
return NULL;
}
@ -783,7 +783,7 @@ ecma_promise_new_capability (ecma_value_t constructor, /**< constructor function
{
ecma_free_value (promise);
ecma_deref_object (capability_obj_p);
ecma_raise_type_error (ECMA_ERR_MSG ("'resolve' parameter must be callable"));
ecma_raise_type_error (ECMA_ERR_PARAMETER_RESOLVE_MUST_BE_CALLABLE);
return NULL;
}
@ -792,7 +792,7 @@ ecma_promise_new_capability (ecma_value_t constructor, /**< constructor function
{
ecma_free_value (promise);
ecma_deref_object (capability_obj_p);
ecma_raise_type_error (ECMA_ERR_MSG ("'reject' parameter must be callable"));
ecma_raise_type_error (ECMA_ERR_PARAMETER_REJECT_MUST_BE_CALLABLE);
return NULL;
}
@ -818,7 +818,7 @@ ecma_promise_reject_or_resolve (ecma_value_t this_arg, /**< "this" argument */
{
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
if (is_resolve && ecma_is_value_object (value) && ecma_is_promise (ecma_get_object_from_value (value)))
@ -882,14 +882,14 @@ ecma_promise_then (ecma_value_t promise, /**< the promise which call 'then' */
{
if (!ecma_is_value_object (promise))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj = ecma_get_object_from_value (promise);
if (!ecma_is_promise (obj))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Promise"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_PROMISE);
}
ecma_value_t species = ecma_op_species_constructor (obj, ECMA_BUILTIN_ID_PROMISE);
@ -1064,7 +1064,7 @@ ecma_promise_finally (ecma_value_t promise, /**< the promise which call 'finally
/* 2. */
if (!ecma_is_value_object (promise))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *obj = ecma_get_object_from_value (promise);

View File

@ -57,7 +57,7 @@ ecma_proxy_create (ecma_value_t target, /**< proxy target */
/* ES11+: 1 - 2. */
if (!ecma_is_value_object (target) || !ecma_is_value_object (handler))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Cannot create Proxy with a non-object target or handler"));
ecma_raise_type_error (ECMA_ERR_CANNOT_CREATE_PROXY);
return NULL;
}
@ -240,7 +240,7 @@ ecma_validate_proxy_object (ecma_value_t handler, /**< proxy handler */
{
if (ecma_is_value_null (handler))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Handler cannot be null"));
return ecma_raise_type_error (ECMA_ERR_HANDLER_CANNOT_BE_NULL);
}
JERRY_ASSERT (ecma_is_value_object (handler));
@ -308,7 +308,7 @@ ecma_proxy_object_get_prototype_of (ecma_object_t *obj_p) /**< proxy object */
{
ecma_free_value (handler_proto);
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned neither object nor null"));
return ecma_raise_type_error (ECMA_ERR_TRAP_RETURNED_NEITHER_OBJECT_NOR_NULL);
}
if (obj_p->u2.prototype_cp & JERRY_PROXY_SKIP_RESULT_VALIDATION)
@ -349,8 +349,7 @@ ecma_proxy_object_get_prototype_of (ecma_object_t *obj_p) /**< proxy object */
{
ecma_free_value (handler_proto);
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Proxy target is non-extensible, but the trap did not "
"return its actual prototype"));
ret_value = ecma_raise_type_error (ECMA_ERR_TARGET_NOT_EXTENSIBLE_NOT_RETURNED_ITS_PROTOTYPE);
}
ecma_free_value (target_proto);
@ -471,8 +470,7 @@ ecma_proxy_object_set_prototype_of (ecma_object_t *obj_p, /**< proxy object */
/* 16. */
if (boolean_trap_result && (target_proto != proto))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Target object is non-extensible and trap "
"returned different prototype"));
ret_value = ecma_raise_type_error (ECMA_ERR_TARGET_NOT_EXTENSIBLE_DIFFERENT_PROTOTYPE_RETURNED);
}
ecma_free_value (target_proto);
@ -567,7 +565,7 @@ ecma_proxy_object_is_extensible (ecma_object_t *obj_p) /**< proxy object */
/* 12. */
if (boolean_trap_result != target_result)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap result does not reflect extensibility of Proxy target"));
return ecma_raise_type_error (ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_EXTENSIBILITY);
}
return ecma_make_boolean_value (boolean_trap_result);
@ -651,7 +649,7 @@ ecma_proxy_object_prevent_extensions (ecma_object_t *obj_p) /**< proxy object */
if (ecma_is_value_true (target_is_ext))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap result does not reflect inextensibility of Proxy target"));
return ecma_raise_type_error (ECMA_ERR_TRAP_RESULT_NOT_REFLECT_TARGET_INEXTENSIBILITY);
}
}
@ -723,7 +721,7 @@ ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p, /**< proxy
if (!ecma_is_value_object (trap_result) && !ecma_is_value_undefined (trap_result))
{
ecma_free_value (trap_result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap is neither an object nor undefined"));
return ecma_raise_type_error (ECMA_ERR_TRAP_IS_NEITHER_AN_OBJECT_NOR_UNDEFINED);
}
if (obj_p->u2.prototype_cp & JERRY_PROXY_SKIP_RESULT_VALIDATION)
@ -768,8 +766,7 @@ ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p, /**< proxy
if (!(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE))
{
ecma_free_property_descriptor (&target_desc);
return ecma_raise_type_error (ECMA_ERR_MSG ("Given property is a non-configurable"
" data property on the proxy target"));
return ecma_raise_type_error (ECMA_ERR_GIVEN_PROPERTY_IS_A_NON_CONFIGURABLE);
}
/* .c */
@ -788,7 +785,7 @@ ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p, /**< proxy
/* .f */
if (ecma_is_value_false (extensible_target))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Target not extensible"));
return ecma_raise_type_error (ECMA_ERR_TARGET_NOT_EXTENSIBLE);
}
/* .g */
@ -846,7 +843,7 @@ ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p, /**< proxy
if (!is_valid)
{
ecma_free_property_descriptor (prop_desc_p);
return ecma_raise_type_error (ECMA_ERR_MSG ("The two descriptors are incompatible"));
return ecma_raise_type_error (ECMA_ERR_THE_TWO_DESCRIPTORS_ARE_INCOMPATIBLE);
}
/* 22. */
@ -858,7 +855,7 @@ ecma_proxy_object_get_own_property_descriptor (ecma_object_t *obj_p, /**< proxy
|| ((prop_desc_p->flags & mask) == JERRY_PROP_IS_WRITABLE_DEFINED && target_is_writable))
{
ecma_free_property_descriptor (prop_desc_p);
return ecma_raise_type_error (ECMA_ERR_MSG ("The two descriptors are incompatible"));
return ecma_raise_type_error (ECMA_ERR_THE_TWO_DESCRIPTORS_ARE_INCOMPATIBLE);
}
}
return ECMA_VALUE_TRUE;
@ -981,14 +978,12 @@ ecma_proxy_object_define_own_property (ecma_object_t *obj_p, /**< proxy object *
{
if (!is_target_ext)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for adding property "
"to the non-extensible target"));
return ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_ADDING_PROPERTY_NON_EXTENSIBLE_TARGET);
}
if (setting_config_false)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
"which is non-existent in the target"));
return ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY);
}
}
/* 20. */
@ -998,13 +993,11 @@ ecma_proxy_object_define_own_property (ecma_object_t *obj_p, /**< proxy object *
if (!ecma_op_is_compatible_property_descriptor (prop_desc_p, &target_desc, is_target_ext))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for adding property that is "
"incompatible with the existing property in the target"));
ret_value = ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_ADD_PROPERTY_INCOMPATIBLE_OTHER_PROP);
}
else if (setting_config_false && (target_desc.flags & JERRY_PROP_IS_CONFIGURABLE))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
"which is configurable in the target"));
ret_value = ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY);
}
/* ES11: 16.c */
else if ((target_desc.flags & (JERRY_PROP_IS_VALUE_DEFINED | JERRY_PROP_IS_WRITABLE_DEFINED)) != 0
@ -1013,8 +1006,7 @@ ecma_proxy_object_define_own_property (ecma_object_t *obj_p, /**< proxy object *
&& (target_desc.flags & (JERRY_PROP_IS_WRITABLE | JERRY_PROP_IS_CONFIGURABLE)) == JERRY_PROP_IS_WRITABLE)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
"which is configurable in the target"));
ret_value = ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_DEFINING_NON_EXISTENT_PROPERTY);
}
ecma_free_property_descriptor (&target_desc);
@ -1110,8 +1102,7 @@ ecma_proxy_object_has (ecma_object_t *obj_p, /**< proxy object */
if (!prop_is_configurable)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned falsish for property which exists "
"in the proxy target as non-configurable"));
return ecma_raise_type_error (ECMA_ERR_TRAP_FALSISH_PROPERTY_NON_CONFIGURABLE);
}
ecma_value_t extensible_target = ecma_builtin_object_object_is_extensible (target_obj_p);
@ -1123,8 +1114,7 @@ ecma_proxy_object_has (ecma_object_t *obj_p, /**< proxy object */
if (ecma_is_value_false (extensible_target))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned falsish for property but "
"the proxy target is not extensible"));
return ecma_raise_type_error (ECMA_ERR_TRAP_FALSISH_PROPERTY_TARGET_NOT_EXTENSIBLE);
}
}
}
@ -1209,14 +1199,13 @@ ecma_proxy_object_get (ecma_object_t *obj_p, /**< proxy object */
if ((target_desc.flags & JERRY_PROP_IS_VALUE_DEFINED) && !(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE)
&& !(target_desc.flags & JERRY_PROP_IS_WRITABLE) && !ecma_op_same_value (trap_result, target_desc.value))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incorrect value is returned by a Proxy 'get' trap"));
ret_value = ecma_raise_type_error (ECMA_ERR_INCORRECT_RETURN_PROXY_GET_TRAP);
}
else if (!(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE)
&& (target_desc.flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED))
&& target_desc.get_p == NULL && !ecma_is_value_undefined (trap_result))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Property of a Proxy is non-configurable and "
"does not have a getter function"));
ret_value = ecma_raise_type_error (ECMA_ERR_PROXY_PROPERTY_NOT_CONFIGURABLE_NOT_HAVE_GETTER);
}
ecma_free_property_descriptor (&target_desc);
@ -1303,7 +1292,7 @@ ecma_proxy_object_set (ecma_object_t *obj_p, /**< proxy object */
{
if (is_strict)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Proxy trap returned falsish"));
return ecma_raise_type_error (ECMA_ERR_PROXY_TRAP_RETURNED_FALSISH);
}
return ECMA_VALUE_FALSE;
@ -1333,14 +1322,13 @@ ecma_proxy_object_set (ecma_object_t *obj_p, /**< proxy object */
if ((target_desc.flags & JERRY_PROP_IS_VALUE_DEFINED) && !(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE)
&& !(target_desc.flags & JERRY_PROP_IS_WRITABLE) && !ecma_op_same_value (value, target_desc.value))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incorrect value is returned by a Proxy 'set' trap"));
ret_value = ecma_raise_type_error (ECMA_ERR_INCORRECT_RETURN_PROXY_SET_TRAP);
}
else if (!(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE)
&& (target_desc.flags & (JERRY_PROP_IS_GET_DEFINED | JERRY_PROP_IS_SET_DEFINED))
&& target_desc.set_p == NULL)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("The property of a Proxy target is a non "
"configurable accessor without a setter"));
ret_value = ecma_raise_type_error (ECMA_ERR_TARGET_PROPERTY_CONFIGURE_ACCESSOR_WITHOUT_SETTER);
}
ecma_free_property_descriptor (&target_desc);
@ -1451,15 +1439,14 @@ ecma_proxy_object_delete_property (ecma_object_t *obj_p, /**< proxy object */
/* 15. */
if (!(target_desc.flags & JERRY_PROP_IS_CONFIGURABLE))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for property which is "
"non-configurable in the proxy target"));
ret_value = ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_PROPERTY_NON_CONFIGURABLE);
}
/* ES11: 13-14 */
ecma_value_t extensible_target = ecma_builtin_object_object_is_extensible (target_obj_p);
if (!ecma_is_value_true (extensible_target))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for target is not extensible"));
ret_value = ecma_raise_type_error (ECMA_ERR_TRAP_TRUISH_TARGET_NOT_EXTENSIBLE);
}
ecma_free_property_descriptor (&target_desc);
@ -1551,7 +1538,7 @@ ecma_proxy_check_invariants_for_own_prop_keys (ecma_collection_t *trap_result,
unchecked_result_keys,
&unchecked_prop_name_counter)))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Trap result did not include all non-configurable keys"));
ecma_raise_type_error (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_NON_CONFIGURABLE_KEYS);
}
/* 22. */
else if (ecma_is_value_true (extensible_target))
@ -1563,12 +1550,12 @@ ecma_proxy_check_invariants_for_own_prop_keys (ecma_collection_t *trap_result,
unchecked_result_keys,
&unchecked_prop_name_counter)))
{
ecma_raise_type_error (ECMA_ERR_MSG ("Trap result did not include all configurable keys"));
ecma_raise_type_error (ECMA_ERR_TRAP_RESULT_NOT_INCLUDE_ALL_CONFIGURABLE_KEYS);
}
/* 24. */
else if (unchecked_result_keys->item_count != unchecked_prop_name_counter)
{
ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned extra keys for a non-extensible Proxy target"));
ecma_raise_type_error (ECMA_ERR_TRAP_EXTRA_KEYS_FOR_A_NON_EXTENSIBLE_TARGET);
}
/* 25. */
else
@ -1649,7 +1636,7 @@ ecma_proxy_object_own_property_keys (ecma_object_t *obj_p) /**< proxy object */
if (ecma_collection_check_duplicated_entries (trap_result))
{
ecma_collection_free (trap_result);
ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned with duplicated entries"));
ecma_raise_type_error (ECMA_ERR_TRAP_WITH_DUPLICATED_ENTRIES);
return NULL;
}
@ -1760,7 +1747,7 @@ ecma_proxy_object_call (ecma_object_t *obj_p, /**< proxy object */
if (!ecma_op_proxy_object_is_callable (obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_expected_a_function));
return ecma_raise_type_error (ECMA_ERR_EXPECTED_A_FUNCTION);
}
ECMA_CHECK_STACK_USAGE ();
@ -1873,7 +1860,7 @@ ecma_proxy_object_construct (ecma_object_t *obj_p, /**< proxy object */
{
ecma_free_value (new_obj);
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap must return with an object"));
return ecma_raise_type_error (ECMA_ERR_TRAP_MUST_RETURN_WITH_AN_OBJECT);
}
/* 12. */

View File

@ -308,7 +308,7 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
#endif /* JERRY_ESNEXT */
@ -336,7 +336,7 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG (ecma_error_let_const_not_initialized));
return ecma_raise_reference_error (ECMA_ERR_LET_CONST_NOT_INITIALIZED);
}
return ecma_fast_copy_value (property_value_p->value);
@ -410,7 +410,7 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
ecma_value_t error_value =
ecma_raise_standard_error_with_format (JERRY_ERROR_REFERENCE, "% is not defined", name_val);
#else /* JERRY_ERROR_MESSAGES */
ecma_value_t error_value = ecma_raise_reference_error (NULL);
ecma_value_t error_value = ecma_raise_reference_error (ECMA_ERR_EMPTY);
#endif /* !JERRY_ERROR_MESSAGES */
return error_value;
} /* ecma_op_resolve_reference_value */

View File

@ -114,7 +114,7 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag
if (flag == RE_FLAG_EMPTY || (result_flags & flag) != 0)
{
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid RegExp flags"));
ret_value = ecma_raise_syntax_error (ECMA_ERR_INVALID_REGEXP_FLAGS);
break;
}
@ -1883,7 +1883,7 @@ match_found:
if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Stack limit exceeded"));
ret_value = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
goto cleanup_context;
}
@ -1973,7 +1973,7 @@ ecma_regexp_search_helper (ecma_value_t regexp_arg, /**< regexp argument */
/* 2. */
if (!ecma_is_value_object (regexp_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_value_t result = ECMA_VALUE_ERROR;
@ -2079,7 +2079,7 @@ ecma_regexp_split_helper (ecma_value_t this_arg, /**< this value */
/* 2. */
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_value_t result = ECMA_VALUE_ERROR;
@ -2447,7 +2447,7 @@ cleanup_string:
if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
{
result = ecma_raise_range_error (ECMA_ERR_MSG ("Stack limit exceeded"));
result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
goto cleanup_array;
}
@ -2472,7 +2472,7 @@ cleanup_string:
if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
{
result = ecma_raise_range_error (ECMA_ERR_MSG ("Stack limit exceeded"));
result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
goto cleanup_array;
}
@ -2658,7 +2658,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
{
if (ECMA_RE_STACK_LIMIT_REACHED (matched_p))
{
result = ecma_raise_range_error (ECMA_ERR_MSG ("Stack limit exceeded"));
result = ecma_raise_range_error (ECMA_ERR_STACK_LIMIT_EXCEEDED);
goto cleanup_builder;
}
@ -2830,7 +2830,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
/* 2. */
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg);
@ -2956,7 +2956,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
if (!ecma_is_value_object (result) && !ecma_is_value_null (result))
{
ecma_free_value (result);
result = ecma_raise_type_error (ECMA_ERR_MSG ("Return value of 'exec' must be an object or null"));
result = ecma_raise_type_error (ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL);
goto cleanup_results;
}
}
@ -2966,7 +2966,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
if (!ecma_object_class_is (this_obj_p, ECMA_OBJECT_CLASS_REGEXP))
{
result = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a valid RegExp object"));
result = ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP_OBJECT);
goto cleanup_results;
}
@ -3305,7 +3305,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
{
if (!ecma_is_value_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
ecma_string_t *str_p = ecma_op_to_string (string_arg);
@ -3503,7 +3503,7 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
if (!ecma_is_value_object (result) && !ecma_is_value_null (result))
{
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("Return value of 'exec' must be an object or null"));
return ecma_raise_type_error (ECMA_ERR_RETURN_VALUE_OF_EXEC_MUST_BE_AN_OBJECT_OR_NULL);
}
return result;
@ -3516,7 +3516,7 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
if (!ecma_object_is_regexp_object (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a valid RegExp"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_REG_EXP);
}
return ecma_regexp_exec_helper (arg_obj_p, str_p);

View File

@ -104,7 +104,7 @@ ecma_op_create_shared_arraybuffer_object (const ecma_value_t *arguments_list_p,
if (length_num <= -1.0 || length_num > (ecma_number_t) maximum_size_in_byte + 0.5)
{
ecma_deref_object (proto_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid Shared ArrayBuffer length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_SHARED_ARRAYBUFFER_LENGTH);
}
}

View File

@ -170,7 +170,7 @@ ecma_symbol_this_value (ecma_value_t this_arg) /**< this argument value */
}
/* 3. */
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' must be a Symbol"));
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_SYMBOL);
} /* ecma_symbol_this_value */
#endif /* JERRY_ESNEXT */

View File

@ -811,7 +811,7 @@ ecma_typedarray_create_object_with_length (uint32_t array_length, /**< length of
ecma_free_value (array_length_value);
return result;
#else /* !JERRY_ERROR_MESSAGES */
return ecma_raise_range_error (NULL);
return ecma_raise_range_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
}
@ -850,7 +850,7 @@ ecma_typedarray_create_object_with_length (uint32_t array_length, /**< length of
if (ecma_arraybuffer_is_detached (src_buffer_p))
{
ecma_deref_object (new_arraybuffer_p);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
}
@ -925,7 +925,7 @@ ecma_typedarray_create_object_with_typedarray (ecma_object_t *typedarray_p, /**<
if ((ECMA_TYPEDARRAY_IS_BIGINT_TYPE (src_id) ^ ECMA_TYPEDARRAY_IS_BIGINT_TYPE (typedarray_id)) == 1)
{
ecma_deref_object (new_typedarray_p);
return ecma_raise_type_error (ECMA_ERR_MSG ("Incompatible TypedArray types"));
return ecma_raise_type_error (ECMA_ERR_INCOMPATIBLE_TYPEDARRAY_TYPES);
}
#endif /* JERRY_BUILTIN_BIGINT */
@ -1159,7 +1159,7 @@ ecma_typedarray_create_object_with_object (ecma_value_t items_val, /**< the sour
if (length_index >= UINT32_MAX)
{
ecma_deref_object (arraylike_object_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid TypedArray length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_TYPEDARRAY_LENGTH);
}
uint32_t len = (uint32_t) length_index;
@ -1392,7 +1392,7 @@ ecma_op_typedarray_from (ecma_value_t this_val, /**< this value */
if (length_index >= UINT32_MAX)
{
ecma_deref_object (arraylike_object_p);
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid TypedArray length"));
return ecma_raise_range_error (ECMA_ERR_INVALID_TYPEDARRAY_LENGTH);
}
uint32_t len = (uint32_t) length_index;
@ -1614,7 +1614,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
"Invalid typed array length: %",
arguments_list_p[0]);
#else /* !JERRY_ERROR_MESSAGES */
return ecma_raise_range_error (NULL);
return ecma_raise_range_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
}
@ -1658,7 +1658,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
}
else
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset"));
return ecma_raise_range_error (ECMA_ERR_INVALID_OFFSET);
}
}
@ -1671,14 +1671,12 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
if (ecma_arraybuffer_is_detached (arraybuffer_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
const char *invalid_length_p = ECMA_ERR_MSG ("Invalid length");
if (offset > UINT32_MAX)
{
return ecma_raise_range_error (invalid_length_p);
return ecma_raise_range_error (ECMA_ERR_INVALID_LENGTH);
}
uint32_t byte_offset = (uint32_t) offset;
@ -1690,7 +1688,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
{
if ((buf_byte_length % (uint32_t) (1 << element_size_shift) != 0) || (buf_byte_length < byte_offset))
{
return ecma_raise_range_error (invalid_length_p);
return ecma_raise_range_error (ECMA_ERR_INVALID_LENGTH);
}
new_byte_length = (uint32_t) (buf_byte_length - byte_offset);
@ -1699,14 +1697,14 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
{
if (new_length > (UINT32_MAX >> element_size_shift))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum TypedArray size is reached"));
return ecma_raise_range_error (ECMA_ERR_MAXIMUM_TYPEDARRAY_SIZE_IS_REACHED);
}
new_byte_length = (uint32_t) new_length << element_size_shift;
if (byte_offset > buf_byte_length || new_byte_length > (buf_byte_length - byte_offset))
{
return ecma_raise_range_error (invalid_length_p);
return ecma_raise_range_error (ECMA_ERR_INVALID_LENGTH);
}
}
@ -1927,7 +1925,7 @@ ecma_typedarray_create (ecma_object_t *constructor_p, /**< constructor function
if (!ecma_is_typedarray (ret_val))
{
ecma_free_value (ret_val);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructed object is not TypedArray"));
return ecma_raise_type_error (ECMA_ERR_CONSTRUCTED_OBJECT_IS_NOT_TYPEDARRAY);
}
ecma_object_t *typedarray_p = ecma_get_object_from_value (ret_val);
@ -1937,7 +1935,7 @@ ecma_typedarray_create (ecma_object_t *constructor_p, /**< constructor function
if (ecma_arraybuffer_is_detached (arraybuffer_p))
{
ecma_deref_object (typedarray_p);
return ecma_raise_type_error (ECMA_ERR_MSG (ecma_error_arraybuffer_is_detached));
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
}
if ((arguments_list_len == 1) && (ecma_is_value_number (arguments_list_p[0])))
@ -1948,7 +1946,7 @@ ecma_typedarray_create (ecma_object_t *constructor_p, /**< constructor function
if (info.length < num)
{
ecma_free_value (ret_val);
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructed TypedArray is smaller than filter call result"));
return ecma_raise_type_error (ECMA_ERR_TYPEDARRAY_SMALLER_THAN_FILTER_CALL_RESULT);
}
}
return ret_val;
@ -2000,7 +1998,7 @@ ecma_typedarray_species_create (ecma_value_t this_arg, /**< this argument */
if (ECMA_TYPEDARRAY_IS_BIGINT_TYPE (info.id) ^ ECMA_TYPEDARRAY_IS_BIGINT_TYPE (result_info.id))
{
ecma_free_value (result);
return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray returned by [[ContentType]] does not match source"));
return ecma_raise_type_error (ECMA_ERR_CONTENTTYPE_RETURNED_TYPEDARRAY_NOT_MATCH_SOURCE);
}
#endif /* JERRY_BUILTIN_BIGINT */

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
/* This file is automatically generated by the gen-magic-strings.py script
/* This file is automatically generated by the gen-strings.py script
* from lit-magic-strings.ini. Do not edit! */
LIT_MAGIC_STRING_DEF (LIT_MAGIC_STRING__EMPTY, "")

View File

@ -18,7 +18,7 @@
# magic strings, because it must be the terminator character of all magic
# strings.
#
# If the list is modified, tools/gen-magic-strings.py must be executed!
# If the list is modified, tools/gen-strings.py must be executed!
[LIT_MAGIC_STRINGS]

View File

@ -1237,7 +1237,7 @@ parser_error_to_string (parser_error_t error) /**< error code */
#if JERRY_ESNEXT
case PARSER_ERR_VARIABLE_REDECLARED:
{
return ecma_error_local_variable_is_redeclared;
return (const char *) ecma_get_error_utf8 (ECMA_ERR_LOCAL_VARIABLE_IS_REDECLARED);
}
case PARSER_ERR_LEXICAL_SINGLE_STATEMENT:
{

View File

@ -2359,7 +2359,7 @@ parser_parse_source (void *source_p, /**< source code */
jcontext_release_exception ();
}
ecma_raise_syntax_error ("");
ecma_raise_syntax_error (ECMA_ERR_EMPTY);
#endif /* JERRY_ERROR_MESSAGES */
return NULL;
@ -3132,7 +3132,7 @@ parser_parse_script (void *source_p, /**< source code */
JERRY_UNUSED (parse_opts);
JERRY_UNUSED (resource_name);
ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
ecma_raise_syntax_error (ECMA_ERR_PARSER_NOT_SUPPORTED);
return NULL;
#endif /* JERRY_PARSER */
} /* parser_parse_script */

View File

@ -228,7 +228,7 @@ re_check_quantifier (re_compiler_ctx_t *re_ctx_p)
if (re_ctx_p->token.qmin > re_ctx_p->token.qmax)
{
/* ECMA-262 v5.1 15.10.2.5 */
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Quantifier error: min > max"));
return ecma_raise_syntax_error (ECMA_ERR_MIN_GREATER_THAN_MAX);
}
return ECMA_VALUE_EMPTY;
@ -432,7 +432,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape sequence"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE_SEQUENCE);
}
#endif /* JERRY_ESNEXT */
@ -534,7 +534,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid control escape sequence"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_CONTROL_ESCAPE_SEQUENCE);
}
#endif /* JERRY_ESNEXT */
@ -557,7 +557,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid hex escape sequence"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_HEX_ESCAPE_SEQUENCE);
}
#endif /* JERRY_ESNEXT */
@ -606,7 +606,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
if (JERRY_UNLIKELY (cp > LIT_UNICODE_CODE_POINT_MAX))
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid unicode escape sequence"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE);
}
}
@ -618,7 +618,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
}
}
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid unicode escape sequence"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE);
}
#endif /* JERRY_ESNEXT */
@ -632,7 +632,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
/* Must be '/', or one of SyntaxCharacter */
if (re_ctx_p->flags & RE_FLAG_UNICODE && ch != LIT_CHAR_SLASH && !re_is_syntax_char (ch))
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE);
}
#endif /* JERRY_ESNEXT */
re_ctx_p->token.value = ch;
@ -688,7 +688,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
{
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE);
}
/* DecimalEscape, Backreferences cannot start with a zero digit. */
@ -741,7 +741,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
{
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unterminated group"));
return ecma_raise_syntax_error (ECMA_ERR_UNTERMINATED_GROUP);
}
if (*re_ctx_p->input_curr_p == LIT_CHAR_QUESTION)
@ -749,7 +749,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
re_ctx_p->input_curr_p++;
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid group"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_GROUP);
}
ch = *re_ctx_p->input_curr_p++;
@ -770,7 +770,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
}
else
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid group"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_GROUP);
}
}
else
@ -792,7 +792,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unterminated character class"));
return ecma_raise_syntax_error (ECMA_ERR_UNTERMINATED_CHARACTER_CLASS);
}
return ECMA_VALUE_EMPTY;
@ -801,20 +801,20 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
case LIT_CHAR_ASTERISK:
case LIT_CHAR_PLUS:
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid quantifier"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_QUANTIFIER);
}
case LIT_CHAR_LEFT_BRACE:
{
re_ctx_p->input_curr_p--;
if (ecma_is_value_true (re_parse_quantifier (re_ctx_p)))
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Nothing to repeat"));
return ecma_raise_syntax_error (ECMA_ERR_NOTHING_TO_REPEAT);
}
#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Lone quantifier bracket"));
return ecma_raise_syntax_error (ECMA_ERR_LONE_QUANTIFIER_BRACKET);
}
#endif /* JERRY_ESNEXT */
@ -831,7 +831,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
{
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Lone quantifier bracket"));
return ecma_raise_syntax_error (ECMA_ERR_LONE_QUANTIFIER_BRACKET);
}
/* FALLTHRU */
@ -937,7 +937,7 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
{
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unterminated character class"));
return ecma_raise_syntax_error (ECMA_ERR_UNTERMINATED_CHARACTER_CLASS);
}
if (*re_ctx_p->input_curr_p == LIT_CHAR_RIGHT_SQUARE)
@ -966,7 +966,7 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
re_ctx_p->input_curr_p++;
if (re_ctx_p->input_curr_p >= re_ctx_p->input_end_p)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_ESCAPE);
}
if (*re_ctx_p->input_curr_p == LIT_CHAR_LOWERCASE_B)
@ -1028,7 +1028,7 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
{
if (start > current)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Range out of order in character class"));
return ecma_raise_syntax_error (ECMA_ERR_RANGE_OUT_OF_ORDER_IN_CHARACTER_CLASS);
}
re_class_add_range (re_ctx_p, start, current);
@ -1039,7 +1039,7 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
#if JERRY_ESNEXT
if (re_ctx_p->flags & RE_FLAG_UNICODE)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid character class"));
return ecma_raise_syntax_error (ECMA_ERR_INVALID_CHARACTER_CLASS);
}
#endif /* JERRY_ESNEXT */
@ -1292,7 +1292,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
{
if (expect_eof)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unmatched close bracket"));
return ecma_raise_syntax_error (ECMA_ERR_UNMATCHED_CLOSE_BRACKET);
}
if (!first_alternative)
@ -1307,7 +1307,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
{
if (!expect_eof)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexpected end of pattern"));
return ecma_raise_syntax_error (ECMA_ERR_UNEXPECTED_END_OF_PATTERN);
}
if (!first_alternative)

View File

@ -303,7 +303,7 @@ opfunc_unary_operation (ecma_value_t left_value, /**< left value */
if (is_plus)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Unary plus is not allowed for BigInts"));
ret_value = ecma_raise_type_error (ECMA_ERR_UNARY_PLUS_IS_NOT_ALLOWED_FOR_BIGINTS);
}
else
{

Some files were not shown because too many files have changed in this diff Show More