Remove full stop after error messages (#4524)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -173,7 +173,7 @@ ecma_op_new_array_object_from_length (ecma_length_t length) /**< length of the n
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
if (length > UINT32_MAX)
|
||||
{
|
||||
ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length"));
|
||||
ecma_raise_range_error (ECMA_ERR_MSG ("Invalid Array length"));
|
||||
return NULL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
@@ -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 ("Invalid array length."));
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid Array length"));
|
||||
}
|
||||
|
||||
if (flags & ECMA_ARRAY_OBJECT_SET_LENGTH_FLAG_REJECT)
|
||||
|
||||
@@ -137,7 +137,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)
|
||||
{
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid ArrayBuffer length."));
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid ArrayBuffer length"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,13 +153,13 @@ 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_MSG ("Iterator 'throw' is not available"));
|
||||
}
|
||||
|
||||
result = ecma_async_yield_call (result,
|
||||
async_generator_object_p,
|
||||
ECMA_VALUE_EMPTY,
|
||||
ECMA_ERR_MSG ("Iterator return() is not callable."));
|
||||
ECMA_ERR_MSG ("Iterator 'return' is not callable"));
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (result))
|
||||
{
|
||||
@@ -173,7 +173,7 @@ ecma_async_yield_throw (vm_executable_object_t *async_generator_object_p, /**< a
|
||||
result = ecma_async_yield_call (result,
|
||||
async_generator_object_p,
|
||||
value,
|
||||
ECMA_ERR_MSG ("Iterator throw() is not callable."));
|
||||
ECMA_ERR_MSG ("Iterator 'throw' is not callable"));
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (result))
|
||||
{
|
||||
@@ -366,7 +366,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_MSG ("Value received by yield* is not object"));
|
||||
}
|
||||
|
||||
ecma_object_t *result_obj_p = ecma_get_object_from_value (value);
|
||||
@@ -423,7 +423,7 @@ ecma_await_continue (vm_executable_object_t *executable_object_p, /**< executabl
|
||||
result = ecma_async_yield_call (result,
|
||||
executable_object_p,
|
||||
value,
|
||||
ECMA_ERR_MSG ("Iterator return() is not callable."));
|
||||
ECMA_ERR_MSG ("Iterator 'return' is not callable"));
|
||||
ecma_free_value (value);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (result))
|
||||
@@ -450,8 +450,8 @@ 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."));
|
||||
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_free_value (value);
|
||||
return ecma_raise_type_error (msg_p);
|
||||
@@ -465,7 +465,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_MSG ("Iterator 'return' result is not object"));
|
||||
}
|
||||
return ECMA_VALUE_EMPTY;
|
||||
}
|
||||
@@ -478,7 +478,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_MSG ("Value received by for-async-of is not object"));
|
||||
}
|
||||
|
||||
ecma_object_t *result_obj_p = ecma_get_object_from_value (value);
|
||||
|
||||
@@ -433,7 +433,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 ("add/set function is not callable."));
|
||||
result = ecma_raise_type_error (ECMA_ERR_MSG ("Function add/set is not callable"));
|
||||
goto cleanup_object;
|
||||
}
|
||||
|
||||
@@ -486,7 +486,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_MSG ("Iterator value is not an object"));
|
||||
result = ecma_op_iterator_close (iterator);
|
||||
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (result));
|
||||
goto cleanup_iterator;
|
||||
@@ -575,7 +575,7 @@ ecma_op_container_get_object (ecma_value_t this_arg, /**< this argument */
|
||||
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
ecma_raise_standard_error_with_format (ECMA_ERROR_TYPE,
|
||||
"Expected a % object.",
|
||||
"Expected a % object",
|
||||
ecma_make_string_value (ecma_get_magic_string (lit_id)));
|
||||
#else /* !ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
ecma_raise_type_error (NULL);
|
||||
@@ -797,7 +797,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 ("Callback function is not callable."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
|
||||
}
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_object (predicate));
|
||||
@@ -1057,7 +1057,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_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
|
||||
@@ -1066,7 +1066,7 @@ ecma_op_container_iterator_next (ecma_value_t this_val, /**< this argument */
|
||||
if (ecma_get_object_type (obj_p) != ECMA_OBJECT_TYPE_PSEUDO_ARRAY
|
||||
|| ext_obj_p->u.pseudo_array.type != iterator_type)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an iterator"));
|
||||
}
|
||||
|
||||
ecma_value_t iterated_value = ext_obj_p->u.pseudo_array.u2.iterated_value;
|
||||
|
||||
@@ -59,7 +59,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_MSG ("Argument cannot be converted to an object"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ ecma_op_to_numeric (ecma_value_t value, /**< ecma value */
|
||||
#if ENABLED (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_MSG ("Cannot convert a Symbol value to a number"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -441,7 +441,7 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */
|
||||
#if ENABLED (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_MSG ("Cannot convert a Symbol value to a string"));
|
||||
return NULL;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
@@ -570,7 +570,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_MSG ("Argument cannot be converted to an object"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -728,7 +728,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_MSG ("Expected an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (obj_value);
|
||||
@@ -825,7 +825,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
&& !ecma_is_value_undefined (get_prop_value))
|
||||
{
|
||||
ecma_free_value (get_prop_value);
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function."));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function"));
|
||||
goto free_desc;
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
&& !ecma_is_value_undefined (set_prop_value))
|
||||
{
|
||||
ecma_free_value (set_prop_value);
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function."));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Expected a function"));
|
||||
goto free_desc;
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ ecma_op_to_property_descriptor (ecma_value_t obj_value, /**< object value */
|
||||
if ((prop_desc.flags & (ECMA_PROP_IS_VALUE_DEFINED | ECMA_PROP_IS_WRITABLE_DEFINED))
|
||||
&& (prop_desc.flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_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_MSG ("Accessors cannot be writable"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1105,7 +1105,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 ("Argument is not an Object."));
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
|
||||
return NULL;
|
||||
}
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (arr);
|
||||
@@ -1135,7 +1135,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_MSG ("Property name is neither Symbol nor string"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ 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_MSG ("Argument 'buffer' is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *buffer_p = ecma_get_object_from_value (buffer);
|
||||
|
||||
if (!ecma_object_class_is (buffer_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument buffer is not an arraybuffer."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'buffer' is not an ArrayBuffer"));
|
||||
}
|
||||
|
||||
/* 3. */
|
||||
@@ -80,7 +80,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 ("ArrayBuffer has been detached."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
|
||||
}
|
||||
|
||||
/* 5. */
|
||||
@@ -89,7 +89,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_MSG ("Start offset is outside the bounds of the buffer"));
|
||||
}
|
||||
|
||||
/* 7. */
|
||||
@@ -108,7 +108,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_MSG ("Start offset is outside the bounds of the buffer"));
|
||||
}
|
||||
|
||||
JERRY_ASSERT (byte_length_to_index <= UINT32_MAX);
|
||||
@@ -132,7 +132,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 ("ArrayBuffer has been detached."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
|
||||
}
|
||||
|
||||
/* 9. */
|
||||
@@ -177,7 +177,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_MSG ("Expected a DataView object"));
|
||||
return NULL;
|
||||
} /* ecma_op_dataview_get_object */
|
||||
|
||||
@@ -300,7 +300,7 @@ ecma_op_dataview_get_set_view_value (ecma_value_t view, /**< the operation's 'vi
|
||||
if (ecma_arraybuffer_is_detached (buffer_p))
|
||||
{
|
||||
ecma_free_value (value_to_set);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
|
||||
}
|
||||
|
||||
/* GetViewValue 7., SetViewValue 9. */
|
||||
@@ -316,7 +316,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_MSG ("Start offset is outside the bounds of the buffer"));
|
||||
}
|
||||
|
||||
/* GetViewValue 11., SetViewValue 13. */
|
||||
|
||||
@@ -114,7 +114,7 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
|
||||
JERRY_UNUSED (code_buffer_size);
|
||||
JERRY_UNUSED (parse_opts);
|
||||
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("The parser has been disabled."));
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Source code parsing is disabled"));
|
||||
#endif /* ENABLED (JERRY_PARSER) */
|
||||
} /* ecma_op_eval_chars_buffer */
|
||||
|
||||
|
||||
@@ -144,7 +144,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_MSG ("Invalid type for constructor call");
|
||||
}
|
||||
|
||||
while (JERRY_UNLIKELY (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION))
|
||||
@@ -171,36 +171,36 @@ 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 "Script (global) functions cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_GENERATOR:
|
||||
{
|
||||
return "Generator functions cannot be invoked with 'new'.";
|
||||
return "Generator functions cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_ASYNC:
|
||||
{
|
||||
return "Async functions cannot be invoked with 'new'.";
|
||||
return "Async functions cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_ASYNC_GENERATOR:
|
||||
{
|
||||
return "Async generator functions cannot be invoked with 'new'.";
|
||||
return "Async generator functions cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_ACCESSOR:
|
||||
{
|
||||
return "Accessor functions cannot be invoked with 'new'.";
|
||||
return "Accessor functions cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_METHOD:
|
||||
{
|
||||
return "Methods cannot be invoked with 'new'.";
|
||||
return "Methods cannot be invoked with 'new'";
|
||||
}
|
||||
case CBC_FUNCTION_ARROW:
|
||||
{
|
||||
return "Arrow functions cannot be invoked with 'new'.";
|
||||
return "Arrow functions cannot be invoked 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 "Async arrow functions cannot be invoked with 'new'";
|
||||
}
|
||||
}
|
||||
#else /* !ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
@@ -217,7 +217,7 @@ ecma_object_check_constructor (ecma_object_t *obj_p) /**< ecma object */
|
||||
{
|
||||
if (ECMA_GET_SECOND_BIT_FROM_POINTER_TAG (obj_p->u2.prototype_cp) == 0)
|
||||
{
|
||||
return ECMA_ERR_MSG ("Proxy target is not a constructor.");
|
||||
return ECMA_ERR_MSG ("Proxy target is not a constructor");
|
||||
}
|
||||
|
||||
return ECMA_IS_VALID_CONSTRUCTOR;
|
||||
@@ -230,7 +230,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 are not constructors.");
|
||||
return ECMA_ERR_MSG ("Built-in routines have no constructor");
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
@@ -252,7 +252,7 @@ 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_MSG ("Invalid type for constructor call");
|
||||
}
|
||||
|
||||
return ecma_object_check_constructor (ecma_get_object_from_value (value));
|
||||
@@ -824,7 +824,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_MSG ("Prototype from revoked Proxy is invalid"));
|
||||
return NULL;
|
||||
}
|
||||
func_obj_p = ecma_get_object_from_value (proxy_obj_p->target);
|
||||
@@ -888,7 +888,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_MSG ("Object expected"));
|
||||
}
|
||||
|
||||
ecma_object_t *prototype_obj_p = ecma_get_object_from_value (prototype_obj_value);
|
||||
@@ -959,7 +959,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_MSG ("Super binding must be a constructor"));
|
||||
}
|
||||
|
||||
return ecma_make_object_value (super_ctor_p);
|
||||
@@ -1002,7 +1002,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_MSG ("Prototype from revoked Proxy is invalid"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -1123,7 +1123,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
|
||||
{
|
||||
if (JERRY_CONTEXT (current_new_target_p) == NULL)
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor requires 'new'"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -1159,7 +1159,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
|
||||
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_MSG ("Derived constructors may only return object or undefined"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -68,7 +68,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 ("Variables declared by let/const must be"
|
||||
" initialized before reading their value."));
|
||||
" initialized before reading their value"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -229,7 +229,7 @@ ecma_op_put_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 ("Variables declared by let/const must be"
|
||||
" initialized before writing their value."));
|
||||
" initialized before writing their value"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
@@ -241,15 +241,15 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
if (JERRY_UNLIKELY (ECMA_PROPERTY_VALUE_PTR (property_p)->value == ECMA_VALUE_UNINITIALIZED))
|
||||
{
|
||||
return ecma_raise_reference_error (ECMA_ERR_MSG ("Variables declared by let/const must be"
|
||||
" initialized before writing their value."));
|
||||
" initialized before writing their value"));
|
||||
}
|
||||
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
else if (is_strict)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set"));
|
||||
}
|
||||
return ECMA_VALUE_EMPTY;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,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_MSG ("Iterator is not an object"));
|
||||
}
|
||||
|
||||
if (next_method_p != NULL)
|
||||
@@ -297,7 +297,7 @@ ecma_op_iterator_next_old (ecma_value_t iterator, /**< iterator value */
|
||||
if (!ecma_is_value_object (func_next) || !ecma_op_is_callable (func_next))
|
||||
{
|
||||
ecma_free_value (func_next);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator next() is not callable."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'next' is not callable"));
|
||||
}
|
||||
|
||||
ecma_object_t *next_obj_p = ecma_get_object_from_value (func_next);
|
||||
@@ -341,7 +341,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_MSG ("Iterator 'next' is not callable"));
|
||||
}
|
||||
|
||||
ecma_object_t *next_method_obj_p = ecma_get_object_from_value (next_method);
|
||||
@@ -389,7 +389,7 @@ ecma_op_iterator_return (ecma_value_t iterator, /**< iterator value */
|
||||
if (!ecma_is_value_object (func_return) || !ecma_op_is_callable (func_return))
|
||||
{
|
||||
ecma_free_value (func_return);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator return() is not callable."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'return' is not callable"));
|
||||
}
|
||||
|
||||
ecma_object_t *return_obj_p = ecma_get_object_from_value (func_return);
|
||||
@@ -435,13 +435,13 @@ 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_MSG ("Iterator 'throw' is not available"));
|
||||
}
|
||||
|
||||
if (!ecma_is_value_object (func_throw) || !ecma_op_is_callable (func_throw))
|
||||
{
|
||||
ecma_free_value (func_throw);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator throw() is not callable."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Iterator 'throw' is not callable"));
|
||||
}
|
||||
|
||||
ecma_object_t *return_obj_p = ecma_get_object_from_value (func_throw);
|
||||
@@ -553,7 +553,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_MSG ("method 'return' is not callable"));
|
||||
}
|
||||
|
||||
/* 10. */
|
||||
@@ -602,7 +602,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_MSG ("Iterator result is not an object"));
|
||||
}
|
||||
|
||||
/* 3. */
|
||||
@@ -670,7 +670,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_MSG ("Iterator result is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *obj_p = ecma_get_object_from_value (result);
|
||||
|
||||
@@ -264,12 +264,12 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
else if (ecma_is_property_enumerable (*property_p))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
else if (is_strict)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set"));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -334,7 +334,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_MSG ("Binding does not exist or is uninitialised"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -591,7 +591,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."));
|
||||
"accessing 'this' or returning from it"));
|
||||
}
|
||||
|
||||
ecma_ref_object (ecma_get_object_from_value (this_value));
|
||||
|
||||
@@ -42,7 +42,7 @@ ecma_reject (bool is_throw) /**< Throw flag */
|
||||
{
|
||||
if (is_throw)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -145,7 +145,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_MSG ("Expected a configurable property"));
|
||||
}
|
||||
|
||||
/* 5. */
|
||||
@@ -230,7 +230,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 ("Invalid argument type in [[DefaultValue]]."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Result of [[DefaultValue]] is invalid"));
|
||||
}
|
||||
|
||||
ecma_free_value (exotic_to_prim);
|
||||
@@ -306,7 +306,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 ("Invalid argument type in [[DefaultValue]]."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Result of [[DefaultValue]] is invalid"));
|
||||
} /* ecma_op_general_object_ordinary_value */
|
||||
|
||||
/**
|
||||
|
||||
@@ -1002,7 +1002,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_MSG ("Iterator is not callable"));
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
@@ -1987,7 +1987,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_MSG ("Expected a function object"));
|
||||
} /* ecma_op_object_has_instance */
|
||||
|
||||
/**
|
||||
@@ -3006,7 +3006,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_MSG ("Constructor must be an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *ctor_object_p = ecma_get_object_from_value (constructor);
|
||||
@@ -3027,7 +3027,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_MSG ("Species must be a constructor"));
|
||||
}
|
||||
|
||||
return species;
|
||||
|
||||
@@ -243,7 +243,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_MSG ("A promise cannot be resolved with itself"));
|
||||
ecma_value_t exception = jcontext_take_exception ();
|
||||
ecma_reject_promise (promise, exception);
|
||||
ecma_free_value (exception);
|
||||
@@ -673,7 +673,7 @@ ecma_promise_new_capability (ecma_value_t constructor)
|
||||
{
|
||||
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_MSG ("'resolve' parameter must be callable"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -682,7 +682,7 @@ ecma_promise_new_capability (ecma_value_t constructor)
|
||||
{
|
||||
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_MSG ("'reject' parameter must be callable"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -708,7 +708,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
if (is_resolve
|
||||
@@ -862,14 +862,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *obj = ecma_get_object_from_value (promise);
|
||||
|
||||
if (!ecma_is_promise (obj))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a Promise."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Promise"));
|
||||
}
|
||||
|
||||
ecma_value_t species = ecma_op_species_constructor (obj, ECMA_BUILTIN_ID_PROMISE);
|
||||
@@ -1053,7 +1053,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *obj = ecma_get_object_from_value (promise);
|
||||
|
||||
@@ -54,7 +54,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_MSG ("Cannot create Proxy with a non-object target or handler"));
|
||||
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 can not be null"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Handler cannot be null"));
|
||||
}
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_object (handler));
|
||||
@@ -305,7 +305,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_MSG ("Trap returned neither object nor null"));
|
||||
}
|
||||
|
||||
/* 11. */
|
||||
@@ -342,7 +342,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."));
|
||||
"return its actual prototype"));
|
||||
}
|
||||
|
||||
ecma_free_value (target_proto);
|
||||
@@ -447,7 +447,7 @@ ecma_proxy_object_set_prototype_of (ecma_object_t *obj_p, /**< proxy object */
|
||||
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."));
|
||||
"returned different prototype"));
|
||||
}
|
||||
|
||||
ecma_free_value (target_proto);
|
||||
@@ -534,7 +534,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_MSG ("Trap result does not reflect extensibility of Proxy target"));
|
||||
}
|
||||
|
||||
return ecma_make_boolean_value (boolean_trap_result);
|
||||
@@ -617,7 +617,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_MSG ("Trap result does not reflect inextensibility of Proxy target"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,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 not object nor undefined."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap is neither an object nor undefined"));
|
||||
}
|
||||
|
||||
/* 12. */
|
||||
@@ -731,7 +731,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_MSG ("Target not extensible"));
|
||||
}
|
||||
|
||||
/* .g */
|
||||
@@ -789,24 +789,21 @@ 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 not compatible."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("The two descriptors are incompatible"));
|
||||
}
|
||||
|
||||
/* 22. */
|
||||
else if (!(prop_desc_p->flags & ECMA_PROP_IS_CONFIGURABLE))
|
||||
{
|
||||
if (!target_has_desc || target_is_configurable)
|
||||
{
|
||||
ecma_free_property_descriptor (prop_desc_p);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Not compatible."));
|
||||
}
|
||||
const uint16_t mask = (ECMA_PROP_IS_WRITABLE_DEFINED | ECMA_PROP_IS_WRITABLE);
|
||||
|
||||
/* ES11: 17.b */
|
||||
if ((prop_desc_p->flags & (ECMA_PROP_IS_WRITABLE_DEFINED | ECMA_PROP_IS_WRITABLE)) == ECMA_PROP_IS_WRITABLE_DEFINED
|
||||
&& target_is_writable)
|
||||
if (!target_has_desc
|
||||
|| target_is_configurable
|
||||
|| ((prop_desc_p->flags & mask) == ECMA_PROP_IS_WRITABLE_DEFINED
|
||||
&& target_is_writable))
|
||||
{
|
||||
ecma_free_property_descriptor (prop_desc_p);
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Not compatible."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("The two descriptors are incompatible"));
|
||||
}
|
||||
}
|
||||
return ECMA_VALUE_TRUE;
|
||||
@@ -1147,16 +1144,15 @@ ecma_proxy_object_get (ecma_object_t *obj_p, /**< proxy object */
|
||||
&& !(target_desc.flags & ECMA_PROP_IS_WRITABLE)
|
||||
&& !ecma_op_same_value (trap_result, target_desc.value))
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("given property is a read-only and non-configurable"
|
||||
" data property on the proxy target"));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incorrect value is returned by a Proxy 'get' trap"));
|
||||
}
|
||||
else if (!(target_desc.flags & ECMA_PROP_IS_CONFIGURABLE)
|
||||
&& (target_desc.flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED))
|
||||
&& target_desc.get_p == NULL
|
||||
&& !ecma_is_value_undefined (trap_result))
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("given property is a non-configurable property and"
|
||||
" does not have a getter function"));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Property of a Proxy is non-configurable and "
|
||||
"does not have a getter function"));
|
||||
}
|
||||
|
||||
ecma_free_property_descriptor (&target_desc);
|
||||
@@ -1268,16 +1264,14 @@ ecma_proxy_object_set (ecma_object_t *obj_p, /**< proxy object */
|
||||
&& !(target_desc.flags & ECMA_PROP_IS_WRITABLE)
|
||||
&& !ecma_op_same_value (value, target_desc.value))
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("The property exists in the proxy target as a"
|
||||
" non-configurable and non-writable data property"
|
||||
" with a different value."));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Incorrect value is returned by a Proxy 'set' trap"));
|
||||
}
|
||||
else if (!(target_desc.flags & ECMA_PROP_IS_CONFIGURABLE)
|
||||
&& (target_desc.flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED))
|
||||
&& target_desc.set_p == NULL)
|
||||
&& (target_desc.flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED))
|
||||
&& target_desc.set_p == NULL)
|
||||
{
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("The property exists in the proxy target as a"
|
||||
" non-configurable accessor property whitout a setter."));
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("The property of a Proxy target is a non "
|
||||
"configurable accessor without a setter"));
|
||||
}
|
||||
|
||||
ecma_free_property_descriptor (&target_desc);
|
||||
@@ -1381,7 +1375,7 @@ ecma_proxy_object_delete_property (ecma_object_t *obj_p, /**< proxy object */
|
||||
if (!(target_desc.flags & ECMA_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."));
|
||||
"non-configurable in the proxy target"));
|
||||
}
|
||||
/* ES11: 13-14 */
|
||||
ecma_value_t extensible_target = ecma_builtin_object_object_is_extensible (target_obj_p);
|
||||
@@ -1480,7 +1474,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_MSG ("Trap result did not include all non-configurable keys"));
|
||||
}
|
||||
/* 22. */
|
||||
else if (ecma_is_value_true (extensible_target))
|
||||
@@ -1492,12 +1486,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_MSG ("Trap result did 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 but proxy target is non-extensible"));
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned extra keys for a non-extensible Proxy target"));
|
||||
}
|
||||
/* 25. */
|
||||
else
|
||||
@@ -1575,7 +1569,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 duplicate entries"));
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned with duplicated entries"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1790,7 +1784,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 returned non-object"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Trap must return with an object"));
|
||||
}
|
||||
|
||||
/* 12. */
|
||||
|
||||
@@ -311,7 +311,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 ("Variables declared by let/const must be"
|
||||
" initialized before reading their value."));
|
||||
" initialized before reading their value"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
|
||||
@@ -113,7 +113,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_MSG ("Invalid RegExp flags"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1902,7 +1902,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_MSG ("Stack limit exceeded"));
|
||||
goto cleanup_context;
|
||||
}
|
||||
|
||||
@@ -1993,7 +1993,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_value_t result = ECMA_VALUE_ERROR;
|
||||
@@ -2101,7 +2101,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_value_t result = ECMA_VALUE_ERROR;
|
||||
@@ -2483,7 +2483,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_MSG ("Stack limit exceeded"));
|
||||
goto cleanup_array;
|
||||
}
|
||||
|
||||
@@ -2508,7 +2508,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_MSG ("Stack limit exceeded"));
|
||||
goto cleanup_array;
|
||||
}
|
||||
|
||||
@@ -2703,7 +2703,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_MSG ("Stack limit exceeded"));
|
||||
goto cleanup_builder;
|
||||
}
|
||||
|
||||
@@ -2878,7 +2878,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_object_t *this_obj_p = ecma_get_object_from_value (this_arg);
|
||||
@@ -3010,7 +3010,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_MSG ("Return value of 'exec' must be an object or null"));
|
||||
goto cleanup_results;
|
||||
}
|
||||
}
|
||||
@@ -3020,7 +3020,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
|
||||
|
||||
if (!ecma_object_class_is (this_obj_p, LIT_MAGIC_STRING_REGEXP_UL))
|
||||
{
|
||||
result = ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a valid RegExp object"));
|
||||
result = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a valid RegExp object"));
|
||||
goto cleanup_results;
|
||||
}
|
||||
|
||||
@@ -3367,7 +3367,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 ("'this' is not an object."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
|
||||
}
|
||||
|
||||
ecma_string_t *str_p = ecma_op_to_string (string_arg);
|
||||
@@ -3571,7 +3571,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_MSG ("Return value of 'exec' must be an object or null"));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -3584,7 +3584,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 ("'this' is not a valid RegExp object"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a valid RegExp"));
|
||||
}
|
||||
|
||||
return ecma_regexp_exec_helper (arg_obj_p, str_p);
|
||||
|
||||
@@ -174,7 +174,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_MSG ("Argument 'this' must be a Symbol"));
|
||||
} /* ecma_symbol_this_value */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
|
||||
@@ -739,14 +739,14 @@ ecma_typedarray_create_object_with_length (uint32_t array_length, /**< length of
|
||||
{
|
||||
if (array_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_MSG ("Maximum TypedArray size is reached"));
|
||||
}
|
||||
|
||||
uint32_t byte_length = array_length << element_size_shift;
|
||||
|
||||
if (byte_length > UINT32_MAX - sizeof (ecma_extended_object_t) - JMEM_ALIGNMENT + 1)
|
||||
{
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum typedarray size is reached."));
|
||||
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum TypedArray size is reached"));
|
||||
}
|
||||
|
||||
ecma_object_t *new_arraybuffer_p = NULL;
|
||||
@@ -814,7 +814,7 @@ ecma_typedarray_create_object_with_buffer (ecma_object_t *arraybuffer_p, /**< th
|
||||
{
|
||||
if (ecma_arraybuffer_is_detached (arraybuffer_p))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
|
||||
}
|
||||
uint32_t expected_length = (ecma_arraybuffer_get_length (arraybuffer_p) >> element_size_shift);
|
||||
|
||||
@@ -861,7 +861,7 @@ ecma_typedarray_create_object_with_typedarray (ecma_object_t *typedarray_p, /**<
|
||||
ecma_object_t *src_arraybuffer_p = ecma_typedarray_get_arraybuffer (typedarray_p);
|
||||
if (ecma_arraybuffer_is_detached (src_arraybuffer_p))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid detached ArrayBuffer."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid detached ArrayBuffer"));
|
||||
}
|
||||
|
||||
ecma_value_t new_typedarray = ecma_typedarray_create_object_with_length (array_length,
|
||||
@@ -896,7 +896,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_MSG ("Incompatible TypedArray types"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
|
||||
@@ -967,7 +967,7 @@ ecma_op_typedarray_from_helper (ecma_value_t this_val, /**< this_arg for the abo
|
||||
|
||||
if (index >= info_p->length)
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type"));
|
||||
}
|
||||
|
||||
ecma_value_t set_element = setter_cb (info_p->buffer_p + (index << info_p->shift), mapped_value);
|
||||
@@ -1343,7 +1343,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
/* 22.2.1.2 */
|
||||
if (ecma_is_value_undefined (arguments_list_p[0]))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("length argument is undefined"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Length argument is undefined"));
|
||||
}
|
||||
|
||||
ecma_number_t num;
|
||||
@@ -1356,7 +1356,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
|
||||
if (num != ((ecma_number_t) length))
|
||||
{
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid typedarray length."));
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid TypedArray length"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1398,11 +1398,11 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
if (ecma_number_is_negative (offset) || fmod (offset, (1 << element_size_shift)) != 0)
|
||||
{
|
||||
/* ES2015 22.2.1.5: 9 - 10. */
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset."));
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid offset"));
|
||||
}
|
||||
else if (ecma_arraybuffer_is_detached (arraybuffer_p))
|
||||
{
|
||||
ret = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid detached ArrayBuffer."));
|
||||
ret = ecma_raise_type_error (ECMA_ERR_MSG ("Invalid detached ArrayBuffer"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1411,13 +1411,10 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
|
||||
if (ecma_is_value_undefined (arg3))
|
||||
{
|
||||
if (buf_byte_length % (uint32_t) (1 << element_size_shift) != 0)
|
||||
if ((buf_byte_length % (uint32_t) (1 << element_size_shift) != 0)
|
||||
|| (buf_byte_length < offset))
|
||||
{
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
|
||||
}
|
||||
else if (buf_byte_length < offset)
|
||||
{
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1434,7 +1431,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
|
||||
if (new_length > (UINT32_MAX >> element_size_shift))
|
||||
{
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Maximum typedarray size is reached."));
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Maximum TypedArray size is reached"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1442,7 +1439,7 @@ ecma_op_create_typedarray (const ecma_value_t *arguments_list_p, /**< the arg li
|
||||
|
||||
if (((ecma_number_t) new_byte_length + offset) > buf_byte_length)
|
||||
{
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length."));
|
||||
ret = ecma_raise_range_error (ECMA_ERR_MSG ("Invalid length"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1645,7 +1642,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_MSG ("Constructed object is not TypedArray"));
|
||||
}
|
||||
|
||||
ecma_object_t *typedarray_p = ecma_get_object_from_value (ret_val);
|
||||
@@ -1658,7 +1655,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_MSG ("Constructed TypedArray is smaller than filter call result"));
|
||||
}
|
||||
}
|
||||
return ret_val;
|
||||
@@ -1710,7 +1707,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 ("Source and result array does not match in [[ContentType]]"));
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("TypedArray returned by [[ContentType]] does not match source"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user