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:
Zoltan Herczeg
2021-01-28 12:10:13 +01:00
committed by GitHub
parent e081cbc2f0
commit ba06d492a3
82 changed files with 551 additions and 523 deletions
+1 -1
View File
@@ -2134,7 +2134,7 @@ do \
{ \
if (ecma_get_current_stack_usage () > CONFIG_MEM_STACK_LIMIT) \
{ \
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum call stack size exceeded.")); \
return ecma_raise_range_error (ECMA_ERR_MSG ("Maximum call stack size exceeded")); \
} \
} while (0)
#else /* JERRY_STACK_LIMIT == 0) */
+1 -1
View File
@@ -2603,7 +2603,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_MSG ("Maximum string length is reached"));
}
/* 9 */
+1 -2
View File
@@ -479,8 +479,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 ("Cannot perform 'IsArray' on the given proxy "
"because handler is null"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Proxy handler is null for 'isArray' operation"));
}
return ecma_is_value_array (proxy_obj_p->target);
+8 -8
View File
@@ -398,7 +398,7 @@ ecma_module_resolve_export (ecma_module_t *const module_p, /**< base module */
if (ecma_compare_ecma_string_to_magic_id (current_export_name_p, LIT_MAGIC_STRING_DEFAULT))
{
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("No default export in native module."));
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("No default export in native module"));
break;
}
@@ -480,7 +480,7 @@ ecma_module_resolve_export (ecma_module_t *const module_p, /**< base module */
/* 15.2.1.16.3 / 6 */
if (ecma_compare_ecma_string_to_magic_id (current_export_name_p, LIT_MAGIC_STRING_DEFAULT))
{
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("No explicitly defined default export in module."));
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("No explicitly defined default export in module"));
break;
}
@@ -529,7 +529,7 @@ ecma_module_resolve_export (ecma_module_t *const module_p, /**< base module */
}
else
{
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexported or circular import request."));
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Unexported or circular import request"));
}
return ret_value;
@@ -766,7 +766,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_MSG ("Imported binding shadows local variable"));
}
ecma_value_t status = ecma_op_has_binding (lex_env_p, import_names_p->local_name_p);
@@ -780,7 +780,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_MSG ("Imported binding shadows local variable"));
}
import_names_p = import_names_p->next_p;
@@ -831,7 +831,7 @@ ecma_module_connect_imports (ecma_module_t *module_p)
if (record.module_p == NULL)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Ambiguous import request."));
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Ambiguous import request"));
}
if (record.module_p->state == ECMA_MODULE_STATE_NATIVE)
@@ -916,7 +916,7 @@ ecma_module_check_indirect_exports (ecma_module_t *module_p)
if (record.module_p == NULL)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Ambiguous indirect export request."));
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Ambiguous indirect export request"));
}
name_p = name_p->next_p;
@@ -1004,7 +1004,7 @@ ecma_module_parse (ecma_module_t *module_p) /**< module */
if (source_p == NULL)
{
return ecma_raise_syntax_error (ECMA_ERR_MSG ("File not found."));
return ecma_raise_syntax_error (ECMA_ERR_MSG ("File not found"));
}
ecma_module_t *prev_module_p = JERRY_CONTEXT (module_current_p);
@@ -56,7 +56,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_MSG ("Argument 'this' is not an object"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@@ -66,7 +66,7 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
if (ecma_get_object_type (obj_p) != ECMA_OBJECT_TYPE_PSEUDO_ARRAY
|| ext_obj_p->u.pseudo_array.type != ECMA_PSEUDO_ARRAY_ITERATOR)
{
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;
@@ -87,7 +87,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 ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
/* b. */
@@ -393,7 +393,7 @@ ecma_builtin_array_prototype_object_pop (ecma_object_t *obj_p, /**< object */
if (!ecma_op_ordinary_object_is_extensible (obj_p))
{
ecma_free_value (get_value);
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type"));
}
ecma_delete_fast_array_properties (obj_p, (uint32_t) len);
@@ -443,12 +443,12 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, /
{
if (!ecma_op_ordinary_object_is_extensible (obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument type"));
}
if ((ecma_number_t) (length + arguments_number) > UINT32_MAX)
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length"));
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid Array length"));
}
if (arguments_number == 0)
@@ -1109,7 +1109,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_MSG ("Compare function is not callable"));
}
ecma_length_t len;
@@ -1308,7 +1308,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_MSG ("Invalid new Array length"));
}
/* ES11: 9. */
@@ -1519,7 +1519,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 ("Invalid array length"));
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid Array length"));
}
if (args_number == 0)
@@ -1863,7 +1863,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* We already checked that arg1 is callable */
@@ -1946,7 +1946,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* 6. */
@@ -2040,7 +2040,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* 6. */
@@ -2148,13 +2148,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function 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_MSG ("Reduce of empty Array with no initial value"));
}
JERRY_ASSERT (ecma_is_value_object (args_p[0]));
@@ -2207,7 +2207,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_MSG ("Missing Array element"));
}
}
/* 9. */
@@ -2367,7 +2367,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* We already checked that predicate is callable, so it will always be an object. */
@@ -2851,7 +2851,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* 4. */
@@ -96,7 +96,7 @@ ecma_builtin_array_object_from (ecma_value_t this_arg, /**< 'this' argument */
/* 3.a */
if (!ecma_op_is_callable (mapfn))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
/* 3.b */
@@ -493,7 +493,7 @@ ecma_builtin_array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arg
if (num != ((ecma_number_t) num_uint32))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length."));
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid array length"));
}
return ecma_make_object_value (ecma_op_new_array_object (num_uint32));
@@ -65,7 +65,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 ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
uint32_t len = ecma_arraybuffer_get_length (object_p);
@@ -73,7 +73,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_MSG ("Argument 'this' is not a ArrayBuffer object"));
} /* ecma_builtin_arraybuffer_prototype_bytelength_getter */
/**
@@ -92,7 +92,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 object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
}
ecma_object_t *object_p = ecma_get_object_from_value (this_arg);
@@ -100,7 +100,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 2. */
if (!ecma_object_class_is (object_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an ArrayBuffer object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an ArrayBuffer object"));
}
/* TODO: step 3. if SharedArrayBuffer will be implemented */
@@ -108,7 +108,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 4. */
if (ecma_arraybuffer_is_detached (object_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. */
@@ -170,7 +170,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 13. */
if (!ecma_object_class_is (new_arraybuffer_p, LIT_MAGIC_STRING_ARRAY_BUFFER_UL))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Return value is not an ArrayBuffer object."));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Return value is not an ArrayBuffer object"));
goto free_new_arraybuffer;
}
@@ -179,7 +179,7 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 15. */
if (ecma_arraybuffer_is_detached (new_arraybuffer_p))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Return ArrayBuffer has been detached."));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Returned ArrayBuffer has been detached"));
goto free_new_arraybuffer;
}
@@ -193,14 +193,14 @@ ecma_builtin_arraybuffer_prototype_object_slice (ecma_value_t this_arg, /**< thi
/* 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_MSG ("Derived ArrayBuffer constructor created a too small buffer"));
goto free_new_arraybuffer;
}
/* 19. */
if (ecma_arraybuffer_is_detached (object_p))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Original ArrayBuffer has been detached."));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Original ArrayBuffer has been detached"));
goto free_new_arraybuffer;
}
@@ -115,7 +115,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_MSG ("Argument 'this' is not an async generator object"));
}
if (executable_object_p->extended_object.u.class_prop.extra_info & ECMA_EXECUTABLE_OBJECT_COMPLETED)
@@ -69,7 +69,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_MSG ("BigInt value expected"));
} /* ecma_builtin_bigint_prototype_object_value_of */
/**
@@ -108,7 +108,7 @@ ecma_builtin_bigint_prototype_object_to_string (ecma_value_t this_arg, /**< this
if (arg_num < 2 || arg_num > 36)
{
ecma_free_value (bigint);
return ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36."));
return ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36"));
}
radix = (uint32_t) arg_num;
@@ -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_MSG ("BigInt function is not a constructor"));
} /* ecma_builtin_bigint_dispatch_construct */
/**
@@ -88,7 +88,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_MSG ("Argument 'this' is not a Boolean object"));
} /* ecma_builtin_boolean_prototype_object_value_of */
/**
@@ -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 ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
return ecma_make_uint32_value (obj_p->header.u.class_prop.u.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 ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
return ecma_make_uint32_value (obj_p->byte_offset);
}
@@ -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_MSG ("Constructor DataView requires 'new'"));
} /* ecma_builtin_dataview_dispatch_call */
/**
@@ -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_MSG ("Invalid argument type in toPrimitive"));
} /* ecma_builtin_date_prototype_to_primitive */
#endif /* ENABLED (JERRY_ESNEXT) */
@@ -607,7 +607,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), LIT_MAGIC_STRING_DATE_UL))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a Date object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Date object"));
}
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (this_arg);
@@ -658,7 +658,7 @@ ecma_builtin_date_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< b
{
if (ecma_number_is_nan (*prim_value_p) || ecma_number_is_infinity (*prim_value_p))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("Date must be a finite number."));
return ecma_raise_range_error (ECMA_ERR_MSG ("Date must be a finite number"));
}
return ecma_date_value_to_iso_string (*prim_value_p);
@@ -86,7 +86,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_MSG ("Argument 'this' is not an object"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
@@ -107,7 +107,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 ("Argument is not an object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (arg2);
@@ -123,7 +123,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_MSG ("Too many arguments declared for Function.apply"));
}
/* 6. */
@@ -406,7 +406,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_MSG ("Function.prototype is not a constructor"));
} /* ecma_builtin_function_prototype_dispatch_construct */
/**
@@ -431,7 +431,7 @@ ecma_builtin_function_prototype_dispatch_routine (uint8_t builtin_routine_id, /*
}
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function"));
}
ecma_object_t *func_obj_p = ecma_get_object_from_value (this_arg);
@@ -228,12 +228,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_MSG ("Argument 'this' is not a generator object"));
}
if (executable_object_p->extended_object.u.class_prop.extra_info & ECMA_EXECUTABLE_OBJECT_RUNNING)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Generator is currently under execution."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Generator is currently under execution"));
}
if (executable_object_p->extended_object.u.class_prop.extra_info & ECMA_EXECUTABLE_OBJECT_COMPLETED)
@@ -216,7 +216,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_MSG ("Invalid hexadecimal value"));
}
ecma_char_t decoded_byte = (ecma_char_t) hex_value;
@@ -254,7 +254,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_MSG ("Invalid UTF8 character"));
}
lit_utf8_byte_t octets[LIT_UTF8_MAX_BYTES_IN_CODE_POINT];
@@ -287,7 +287,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
|| !lit_is_valid_utf8_string (octets, bytes_count))
{
ecma_stringbuilder_destroy (&builder);
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 string."));
return ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 string"));
}
lit_code_point_t cp;
@@ -297,7 +297,7 @@ ecma_builtin_global_object_decode_uri_helper (lit_utf8_byte_t *input_start_p, /*
|| 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_MSG ("Invalid UTF8 codepoint"));
}
lit_utf8_byte_t result_chars[LIT_CESU8_MAX_BYTES_IN_CODE_POINT];
@@ -356,7 +356,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_MSG ("Unicode surrogate pair missing"));
}
lit_code_point_t cp = ch;
@@ -366,7 +366,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_MSG ("Unicode surrogate pair missing"));
}
ecma_char_t next_ch;
@@ -380,7 +380,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_MSG ("Unicode surrogate pair missing"));
}
}
@@ -369,7 +369,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 ("Invalid array length."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid array length"));
}
#else /* !ENABLED (JERRY_ESNEXT) */
/* 5.b.ii */
@@ -171,12 +171,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_MSG ("Argument 'this' is not a TypedArray"));
}
if (ecma_arraybuffer_is_detached (ecma_typedarray_get_arraybuffer (ecma_get_object_from_value (this_arg))))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
return ecma_typedarray_iterators_helper (this_arg, ECMA_ITERATOR_VALUES);
@@ -207,7 +207,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), LIT_MAGIC_STRING_DATE_UL))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a Date object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Date object"));
}
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) ecma_get_object_from_value (this_arg);
@@ -818,7 +818,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_MSG ("Invalid JSON format"));
} /*ecma_builtin_json_parse_buffer*/
/**
@@ -1000,7 +1000,7 @@ ecma_builtin_json_serialize_object (ecma_json_stringify_context_t *context_p, /*
/* 1. */
if (ecma_json_has_object_in_stack (context_p->occurence_stack_last_p, obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical"));
}
/* 2. */
@@ -1137,7 +1137,7 @@ ecma_builtin_json_serialize_array (ecma_json_stringify_context_t *context_p, /**
/* 1. */
if (ecma_json_has_object_in_stack (context_p->occurence_stack_last_p, obj_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical"));
}
/* 2. */
@@ -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_MSG ("Constructor Map requires 'new'"));
} /* ecma_builtin_map_dispatch_call */
/**
@@ -168,7 +168,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_MSG ("Radix must be between 2 and 36"));
}
}
@@ -456,7 +456,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_MSG ("Argument 'this' is not a number or a Number object"));
} /* ecma_builtin_number_prototype_object_value_of */
/**
@@ -496,7 +496,7 @@ ecma_builtin_number_prototype_object_to_number_convert (ecma_number_t this_num,
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_MSG ("Fraction digits must be between 0 and 100"));
}
/* Handle NaN separately */
@@ -565,13 +565,13 @@ ecma_builtin_number_prototype_object_to_number_convert (ecma_number_t this_num,
&& (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_MSG ("Fraction digits must be between 0 and 100"));
}
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_MSG ("Precision digits must be between 1 and 100"));
}
num_of_digits = ecma_number_to_decimal (this_num, digits, &exponent);
@@ -240,7 +240,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_MSG ("Getter is not callable"));
}
ecma_object_t *accessor_obj_p = ecma_get_object_from_value (accessor);
@@ -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 ("proto is neither Object nor Null."));
return ecma_raise_type_error (ECMA_ERR_MSG ("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_MSG ("Cannot 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_MSG ("Cannot set [[Prototype]]"));
}
JERRY_ASSERT (ecma_is_value_true (status));
@@ -470,7 +470,7 @@ ecma_builtin_object_object_seal (ecma_object_t *obj_p) /**< routine's argument *
#if ENABLED (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_MSG ("Object cannot be sealed"));
}
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
@@ -501,7 +501,7 @@ ecma_builtin_object_object_freeze (ecma_object_t *obj_p) /**< routine's argument
#if ENABLED (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_MSG ("Object cannot be frozen"));
}
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
@@ -534,7 +534,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 the object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot set [[Extensible]] property of object"));
}
JERRY_ASSERT (ecma_is_value_true (status));
@@ -956,7 +956,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 ("Argument is not an object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
ecma_object_t *obj_p = NULL;
@@ -1025,7 +1025,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_MSG ("The requested property update cannot be performed"));
}
JERRY_ASSERT (ecma_is_value_true (define_own_prop_ret));
@@ -1226,7 +1226,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_MSG ("Iterator value is not an object"));
result = ecma_op_iterator_close (original_iterator);
JERRY_ASSERT (ECMA_IS_VALUE_ERROR (result));
goto cleanup_iterator;
@@ -1415,7 +1415,7 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
#if !ENABLED (JERRY_ESNEXT)
if (!ecma_is_value_object (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
#endif /* !ENABLED (JERRY_ESNEXT) */
@@ -1424,7 +1424,7 @@ ecma_builtin_object_dispatch_routine (uint8_t builtin_routine_id, /**< built-in
#if ENABLED (JERRY_ESNEXT)
if (!ecma_is_value_object (arg1))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
#endif /* ENABLED (JERRY_ESNEXT) */
@@ -136,7 +136,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_MSG ("Resolve method must be callable"));
}
ecma_object_t *resolve_func_p = ecma_get_object_from_value (resolve);
@@ -233,7 +233,7 @@ ecma_builtin_promise_perform_all (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_MSG ("Resolve method must be callable"));
}
ecma_object_t *resolve_func_p = ecma_get_object_from_value (resolve);
@@ -312,7 +312,7 @@ ecma_builtin_promise_perform_all (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_MSG ("Promise.all remaining elements limit reached"));
goto exit;
}
@@ -436,7 +436,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_MSG ("Constructor Promise requires 'new'"));
} /* ecma_builtin_promise_dispatch_call */
/**
@@ -452,7 +452,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_MSG ("First parameter must be callable"));
}
return ecma_op_create_promise_object (arguments_list_p[0], ECMA_PROMISE_EXECUTOR_FUNCTION);
@@ -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 ("Argument is not an Object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
/* 2. */
@@ -159,7 +159,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 ("Argument is not an Object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
ecma_object_t *target_p = ecma_get_object_from_value (arguments_list[0]);
@@ -205,7 +205,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 requires the second argument be an object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Reflect.construct expects an object as second argument"));
}
ecma_collection_t *coll_p = ecma_op_create_list_from_array_like (arguments_list[1], false);
@@ -226,7 +226,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 ("Argument is not an Object."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object"));
}
switch (builtin_routine_id)
@@ -239,7 +239,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 ("proto is neither Object nor Null."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Prototype is neither object nor null"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (arguments_list[0]);
@@ -262,7 +262,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_MSG ("Argument 'this' is not a function"));
}
ecma_object_t *func_obj_p = ecma_get_object_from_value (arguments_list[0]);
@@ -280,7 +280,7 @@ ecma_builtin_regexp_prototype_compile (ecma_value_t this_arg, /**< this */
#if !ENABLED (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 ("'this' is not a RegExp object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a RegExp object"));
}
#endif /* !ENABLED (JERRY_ESNEXT) */
@@ -679,23 +679,21 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
ecma_object_t *obj_p = NULL;
/* 1. && 2. */
if (ecma_is_value_object (this_arg))
{
/* 2. */
obj_p = ecma_get_object_from_value (this_arg);
if (require_regexp && !ecma_object_class_is (obj_p, LIT_MAGIC_STRING_REGEXP_UL))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a RegExp object"));
obj_p = NULL;
}
}
/* 1. */
else
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not an object"));
}
JERRY_ASSERT (obj_p != NULL);
if (obj_p == NULL)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object"));
}
switch (builtin_routine_id)
{
@@ -751,7 +749,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 ("'this' is not a RegExp object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a RegExp object"));
}
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p;
@@ -771,7 +769,7 @@ ecma_builtin_regexp_prototype_dispatch_routine (uint8_t builtin_routine_id, /**<
return ECMA_VALUE_UNDEFINED;
}
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a RegExp object"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a RegExp object"));
}
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) obj_p;
@@ -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_MSG ("Argument 'this' is not an object"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@@ -67,7 +67,7 @@ ecma_builtin_regexp_string_iterator_prototype_object_next (ecma_value_t this_val
if (ecma_get_object_type (obj_p) != ECMA_OBJECT_TYPE_PSEUDO_ARRAY
|| ext_obj_p->u.pseudo_array.type != ECMA_PSEUDO_REGEXP_STRING_ITERATOR)
{
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_regexp_string_iterator_t *regexp_string_iterator_obj = (ecma_regexp_string_iterator_t *) obj_p;
@@ -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 of RegExp call."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid argument is passed to RegExp function"));
}
#endif /* ENABLED (JERRY_ESNEXT) */
@@ -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_MSG ("Constructor Set requires 'new'"));
} /* ecma_builtin_set_dispatch_call */
/**
@@ -54,7 +54,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_MSG ("Argument 'this' is not an object"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_val);
@@ -64,7 +64,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
if (ecma_get_object_type (obj_p) != ECMA_OBJECT_TYPE_PSEUDO_ARRAY
|| ext_obj_p->u.pseudo_array.type != ECMA_PSEUDO_STRING_ITERATOR)
{
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;
@@ -84,7 +84,7 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
if (JERRY_UNLIKELY (position == ECMA_ITERATOR_INDEX_LIMIT))
{
return ecma_raise_range_error (ECMA_ERR_MSG ("String iteration cannot be continued."));
return ecma_raise_range_error (ECMA_ERR_MSG ("String iteration cannot be continued"));
}
/* 7. */
@@ -140,7 +140,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_MSG ("Argument 'this' is not a string or a 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_MSG ("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_MSG ("RegExp argument should have global flag"));
}
}
}
@@ -309,7 +309,7 @@ ecma_builtin_string_object_from_code_point (ecma_value_t this_arg, /**< 'this' a
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 ("Error: Invalid code point"));
return ecma_raise_range_error (ECMA_ERR_MSG ("Invalid code point"));
}
lit_code_point_t code_point = (lit_code_point_t) to_number_num;
@@ -75,7 +75,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_MSG ("Symbol is not a constructor"));
} /* ecma_builtin_symbol_dispatch_construct */
/**
@@ -242,7 +242,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_MSG ("The given argument is not a Symbol"));
}
/* 2-4. */
@@ -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_MSG ("Constructor WeakMap requires 'new'"));
} /* ecma_builtin_weakmap_dispatch_call */
/**
@@ -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_MSG ("Constructor WeakSet requires 'new'"));
} /* ecma_builtin_weakset_dispatch_call */
/**
@@ -1545,7 +1545,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_MSG ("Built-in routines have no constructor"));
}
ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) obj_p;
@@ -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 ("BigInt64Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor BigInt64Array requires 'new'"));
} /* ecma_builtin_bigint64array_dispatch_call */
/**
@@ -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 ("BigUInt64Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor BigUInt64Array requires 'new'"));
} /* ecma_builtin_biguint64array_dispatch_call */
/**
@@ -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 ("Float32Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Float32Array requires 'new'"));
} /* ecma_builtin_float32array_dispatch_call */
/**
@@ -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 ("Float64Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Float64Array requires 'new'"));
} /* ecma_builtin_float64array_dispatch_call */
/**
@@ -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 ("Int16Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int16Array requires 'new'"));
} /* ecma_builtin_int16array_dispatch_call */
/**
@@ -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 ("Int32Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int32Array requires 'new'"));
} /* ecma_builtin_int32array_dispatch_call */
/**
@@ -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 ("Int8Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Int8Array requires 'new'"));
} /* ecma_builtin_int8array_dispatch_call */
/**
@@ -275,7 +275,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_MSG ("Initial value cannot be undefined"));
}
return ecma_copy_value (arguments_list_p[1]);
@@ -511,7 +511,7 @@ ecma_op_typedarray_set_with_typedarray (ecma_value_t this_arg, /**< this argumen
ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (target_typedarray_p);
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"));
}
ecma_typedarray_info_t target_info = ecma_typedarray_get_info (target_typedarray_p);
@@ -520,7 +520,7 @@ ecma_op_typedarray_set_with_typedarray (ecma_value_t this_arg, /**< this argumen
ecma_object_t *src_arraybuffer_p = ecma_typedarray_get_arraybuffer (src_typedarray_p);
if (ecma_arraybuffer_is_detached (src_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"));
}
ecma_typedarray_info_t src_info = ecma_typedarray_get_info (src_typedarray_p);
@@ -614,7 +614,7 @@ ecma_builtin_typedarray_prototype_set (ecma_value_t this_arg, /**< this argument
ecma_object_t *arraybuffer_p = ecma_typedarray_get_arraybuffer (typedarray_p);
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"));
}
ecma_typedarray_info_t target_info = ecma_typedarray_get_info (typedarray_p);
@@ -1710,7 +1710,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_MSG ("Argument 'this' is not a TypedArray"));
}
ecma_object_t *typedarray_p = ecma_get_object_from_value (this_arg);
@@ -1723,13 +1723,13 @@ ecma_builtin_typedarray_prototype_dispatch_routine (uint8_t builtin_routine_id,
if (ecma_arraybuffer_is_detached (info.array_buffer_p)
&& builtin_routine_id != ECMA_TYPEDARRAY_PROTOTYPE_ROUTINE_SUBARRAY)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached."));
return ecma_raise_type_error (ECMA_ERR_MSG ("ArrayBuffer has been detached"));
}
}
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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
switch (builtin_routine_id)
@@ -1796,7 +1796,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 ("Callback function is not callable."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable"));
}
return ecma_builtin_typedarray_prototype_sort (this_arg, &info, arguments_list_p[0]);
@@ -62,7 +62,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 ("'this' is not a constructor."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a constructor"));
}
ecma_value_t source;
@@ -71,7 +71,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_MSG ("No source argument"));
}
source = arguments_list_p[0];
@@ -82,7 +82,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 ("mapfn argument is not callable"));
return ecma_raise_type_error (ECMA_ERR_MSG ("The 'mapfn' argument is not callable"));
}
if (arguments_list_len > 2)
@@ -96,7 +96,7 @@ ecma_builtin_typedarray_from (ecma_value_t this_arg, /**< 'this' argument */
const uint8_t builtin_id = ecma_get_object_builtin_id (obj_p);
if (!ecma_typedarray_helper_is_typedarray (builtin_id))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a typedarray constructor"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray constructor"));
}
ecma_typedarray_type_t typedarray_id = ecma_typedarray_helper_builtin_to_typedarray_id (builtin_id);
@@ -129,7 +129,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 ("'this' is not a constructor."));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a constructor"));
}
ecma_object_t *obj_p = ecma_get_object_from_value (this_arg);
@@ -137,7 +137,7 @@ ecma_builtin_typedarray_of (ecma_value_t this_arg, /**< 'this' argument */
if (!ecma_typedarray_helper_is_typedarray (builtin_id))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("'this' is not a typedarray constructor"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a TypedArray constructor"));
}
ecma_typedarray_type_t typedarray_id = ecma_typedarray_helper_builtin_to_typedarray_id (builtin_id);
@@ -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 ("Uint16Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint16Array requires 'new'"));
} /* ecma_builtin_uint16array_dispatch_call */
/**
@@ -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 ("Uint32Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint32Array requires 'new'"));
} /* ecma_builtin_uint32array_dispatch_call */
/**
@@ -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 ("Uint8Array cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint8Array requires 'new'"));
} /* ecma_builtin_uint8array_dispatch_call */
/**
@@ -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 ("Uint8ClampedArray cannot be directly called"));
return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor Uint8ClampedArray requires 'new'"));
} /* ecma_builtin_uint8clampedarray_dispatch_call */
/**
@@ -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;
+10 -10
View File
@@ -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. */
+1 -1
View File
@@ -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);
+4 -4
View File
@@ -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 */
/**
+4 -4
View File
@@ -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);
+30 -36
View File
@@ -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. */
+1 -1
View File
@@ -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) */
+13 -13
View File
@@ -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) */