Add missing error messages to 'ecma/builtin-objects' (#1443)

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-11-22 14:01:59 +01:00
committed by GitHub
parent 132477f7d5
commit 2622e938d8
12 changed files with 56 additions and 56 deletions
@@ -1195,7 +1195,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 (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("Compare function is not callable."));
}
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
@@ -1992,7 +1992,7 @@ ecma_builtin_array_prototype_object_every (ecma_value_t this_arg, /**< this argu
/* 4. */
if (!ecma_op_is_callable (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2091,7 +2091,7 @@ ecma_builtin_array_prototype_object_some (ecma_value_t this_arg, /**< this argum
/* 4. */
if (!ecma_op_is_callable (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2190,7 +2190,7 @@ ecma_builtin_array_prototype_object_for_each (ecma_value_t this_arg, /**< this a
/* 4. */
if (!ecma_op_is_callable (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2283,7 +2283,7 @@ ecma_builtin_array_prototype_object_map (ecma_value_t this_arg, /**< this argume
/* 4. */
if (!ecma_op_is_callable (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2395,7 +2395,7 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t this_arg, /**< this arg
/* 4. */
if (!ecma_op_is_callable (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2517,7 +2517,7 @@ ecma_builtin_array_prototype_object_reduce (ecma_value_t this_arg, /**< this arg
/* 4. */
if (!ecma_op_is_callable (callbackfn))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2530,7 +2530,7 @@ ecma_builtin_array_prototype_object_reduce (ecma_value_t this_arg, /**< this arg
/* 5. */
if (len_number == ECMA_NUMBER_ZERO && ecma_is_value_undefined (initial_value))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined."));
}
else
{
@@ -2577,7 +2577,7 @@ ecma_builtin_array_prototype_object_reduce (ecma_value_t this_arg, /**< this arg
/* 8.c */
if (!k_present)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Missing array element."));
}
}
/* 9. */
@@ -2672,7 +2672,7 @@ ecma_builtin_array_prototype_object_reduce_right (ecma_value_t this_arg, /**< th
/* 4. */
if (!ecma_op_is_callable (callbackfn))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Callback function is not callable."));
}
else
{
@@ -2684,7 +2684,7 @@ ecma_builtin_array_prototype_object_reduce_right (ecma_value_t this_arg, /**< th
/* 5. */
if (len_number == ECMA_NUMBER_ZERO && ecma_is_value_undefined (initial_value))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Initial value cannot be undefined."));
}
else
{
@@ -2733,7 +2733,7 @@ ecma_builtin_array_prototype_object_reduce_right (ecma_value_t this_arg, /**< th
/* 8.c */
if (!k_present)
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Missing array element."));
}
}
/* 9. */
@@ -112,7 +112,7 @@ ecma_builtin_boolean_prototype_object_value_of (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Boolean object."));
} /* ecma_builtin_boolean_prototype_object_value_of */
/**
@@ -257,7 +257,7 @@ ecma_builtin_date_prototype_get_time (ecma_value_t this_arg) /**< this argument
}
}
return ecma_raise_type_error (ECMA_ERR_MSG (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a Date object."));
} /* ecma_builtin_date_prototype_get_time */
/**
@@ -1137,7 +1137,7 @@ ecma_builtin_date_prototype_to_iso_string (ecma_value_t this_arg) /**< this argu
if (ecma_number_is_nan (prim_num) || ecma_number_is_infinity (prim_num))
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Time must be a finite number."));
}
else
{
@@ -1199,7 +1199,7 @@ ecma_builtin_date_prototype_to_json (ecma_value_t this_arg, /**< this argument *
/* 5. */
if (!ecma_op_is_callable (to_iso))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toISOString' is missing or not a function."));
}
/* 6. */
else
@@ -61,7 +61,7 @@ ecma_builtin_error_prototype_object_to_string (ecma_value_t this_arg) /**< this
// 2.
if (!ecma_is_value_object (this_arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not an object."));
}
else
{
@@ -60,7 +60,7 @@ ecma_builtin_function_prototype_object_to_string (ecma_value_t this_arg) /**< th
if (!ecma_op_is_callable (this_arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
}
else
{
@@ -89,7 +89,7 @@ ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this a
/* 1. */
if (!ecma_op_is_callable (this_arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
}
else
{
@@ -105,7 +105,7 @@ ecma_builtin_function_prototype_object_apply (ecma_value_t this_arg, /**< this a
/* 3. */
if (!ecma_is_value_object (arg2))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -188,7 +188,7 @@ ecma_builtin_function_prototype_object_call (ecma_value_t this_arg, /**< this ar
{
if (!ecma_op_is_callable (this_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
}
else
{
@@ -231,7 +231,7 @@ ecma_builtin_function_prototype_object_bind (ecma_value_t this_arg, /**< this ar
/* 2. */
if (!ecma_op_is_callable (this_arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is not a function."));
}
else
{
@@ -387,7 +387,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 (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("'Function.prototype' is not a constructor."));
} /* ecma_builtin_function_prototype_dispatch_construct */
/**
@@ -774,7 +774,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
if (!lit_read_code_unit_from_hex (input_char_p + 1, 2, &decoded_byte))
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid hexadecimal value."));
break;
}
@@ -830,7 +830,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
if (!lit_read_code_unit_from_hex (input_char_p + 1, 2, &decoded_byte))
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid hexadecimal value."));
break;
}
@@ -868,7 +868,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
}
else
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 character."));
break;
}
@@ -902,7 +902,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
if (!is_valid
|| !lit_is_utf8_string_valid (octets, bytes_count))
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 string."));
break;
}
@@ -912,7 +912,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
if (lit_is_code_point_utf16_high_surrogate (cp)
|| lit_is_code_point_utf16_low_surrogate (cp))
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid UTF8 codepoint."));
break;
}
@@ -931,7 +931,7 @@ ecma_builtin_global_object_decode_uri_helper (ecma_value_t uri, /**< uri argumen
}
else
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Invalid CESU8 string."));
}
}
@@ -1042,7 +1042,7 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
if (lit_is_code_point_utf16_low_surrogate (ch))
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
break;
}
@@ -1052,7 +1052,7 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
{
if (input_char_p == input_end_p)
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
break;
}
@@ -1066,7 +1066,7 @@ ecma_builtin_global_object_encode_uri_helper (ecma_value_t uri, /**< uri argumen
}
else
{
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_uri_error (ECMA_ERR_MSG ("Unicode surrogate pair missing."));
break;
}
}
@@ -165,7 +165,7 @@ ecma_builtin_helper_get_to_locale_string_at_index (ecma_object_t *obj_p, /**< th
}
else
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toLocaleString' is missing or not a function."));
}
ECMA_FINALIZE (to_locale_value);
@@ -737,7 +737,7 @@ ecma_builtin_json_parse (ecma_value_t this_arg, /**< 'this' argument */
if (ecma_is_value_undefined (final_result))
{
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_syntax_error (ECMA_ERR_MSG ("Could not parse JSON string."));
}
else
{
@@ -1412,7 +1412,7 @@ ecma_builtin_json_object (ecma_object_t *obj_p, /**< the object*/
/* 1. */
if (ecma_has_object_value_in_collection (context_p->occurence_stack_p, obj_value))
{
return ecma_raise_type_error (ECMA_ERR_MSG (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
}
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
@@ -1612,7 +1612,7 @@ ecma_builtin_json_array (ecma_object_t *obj_p, /**< the array object*/
/* 1. */
if (ecma_has_object_value_in_collection (context_p->occurence_stack_p, obj_value))
{
return ecma_raise_type_error (ECMA_ERR_MSG (""));
return ecma_raise_type_error (ECMA_ERR_MSG ("The structure is cyclical."));
}
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
@@ -221,7 +221,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_value_t this_arg, /**< this
if (radix < 2 || radix > 36)
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Radix must be between 2 and 36."));
}
else if (radix == 10)
{
@@ -463,7 +463,7 @@ ecma_builtin_number_prototype_object_value_of (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG (""));
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 */
/**
@@ -489,7 +489,7 @@ ecma_builtin_number_prototype_object_to_fixed (ecma_value_t this_arg, /**< this
/* 2. */
if (arg_num <= -1 || arg_num >= 21)
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 20."));
}
else
{
@@ -628,7 +628,7 @@ ecma_builtin_number_prototype_object_to_exponential (ecma_value_t this_arg, /**<
/* 7. */
if (arg_num <= -1.0 || arg_num >= 21.0)
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Fraction digits must be between 0 and 20."));
}
else
{
@@ -816,7 +816,7 @@ ecma_builtin_number_prototype_object_to_precision (ecma_value_t this_arg, /**< t
/* 8. */
else if (arg_num < 1.0 || arg_num >= 22.0)
{
ret_value = ecma_raise_range_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_range_error (ECMA_ERR_MSG ("Precision must be between 1 and 21."));
}
else
{
@@ -104,7 +104,7 @@ ecma_builtin_object_prototype_object_to_locale_string (ecma_value_t this_arg) /*
/* 3. */
if (!ecma_op_is_callable (to_string_val))
{
return_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
return_value = ecma_raise_type_error (ECMA_ERR_MSG ("'toString is missing or not a function.'"));
}
else
{
@@ -114,7 +114,7 @@ ecma_builtin_object_object_get_prototype_of (ecma_value_t this_arg, /**< 'this'
/* 1. */
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -155,7 +155,7 @@ ecma_builtin_object_object_get_own_property_names (ecma_value_t this_arg, /**< '
if (!ecma_is_value_object (arg))
{
/* 1. */
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -186,7 +186,7 @@ ecma_builtin_object_object_seal (ecma_value_t this_arg, /**< 'this' argument */
// 1.
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -260,7 +260,7 @@ ecma_builtin_object_object_freeze (ecma_value_t this_arg, /**< 'this' argument *
// 1.
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -340,7 +340,7 @@ ecma_builtin_object_object_prevent_extensions (ecma_value_t this_arg, /**< 'this
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -372,7 +372,7 @@ ecma_builtin_object_object_is_sealed (ecma_value_t this_arg, /**< 'this' argumen
// 1.
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -444,7 +444,7 @@ ecma_builtin_object_object_is_frozen (ecma_value_t this_arg, /**< 'this' argumen
// 1.
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -522,7 +522,7 @@ ecma_builtin_object_object_is_extensible (ecma_value_t this_arg, /**< 'this' arg
if (!ecma_is_value_object (arg))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -556,7 +556,7 @@ ecma_builtin_object_object_keys (ecma_value_t this_arg, /**< 'this' argument */
if (!ecma_is_value_object (arg))
{
/* 1. */
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -588,7 +588,7 @@ ecma_builtin_object_object_get_own_property_descriptor (ecma_value_t this_arg, /
// 1.
if (!ecma_is_value_object (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
return ret_value;
}
@@ -642,7 +642,7 @@ ecma_builtin_object_object_create (ecma_value_t this_arg, /**< 'this' argument *
// 1.
if (!ecma_is_value_object (arg1) && !ecma_is_value_null (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -698,7 +698,7 @@ ecma_builtin_object_object_define_properties (ecma_value_t this_arg, /**< 'this'
// 1.
if (!ecma_is_value_object (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -805,7 +805,7 @@ ecma_builtin_object_object_define_property (ecma_value_t this_arg, /**< 'this' a
if (!ecma_is_value_object (arg1))
{
ret_value = ecma_raise_type_error (ECMA_ERR_MSG (""));
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Argument is not an object."));
}
else
{
@@ -84,7 +84,7 @@ ecma_builtin_string_prototype_object_to_string (ecma_value_t this_arg) /**< this
}
}
return ecma_raise_type_error (ECMA_ERR_MSG (""));
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 */
/**