Make Date.UTC to conform to the latest ES11 spec (#4250)

Date.UTC should work with only one argument too.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
This commit is contained in:
Csaba Osztrogonác
2020-10-01 16:34:09 +02:00
committed by GitHub
parent aa89d38df3
commit e227634b45
4 changed files with 23 additions and 5 deletions
@@ -617,7 +617,13 @@ ecma_builtin_date_utc (ecma_value_t this_arg, /**< this argument */
{
JERRY_UNUSED (this_arg);
if (args_number < 2)
#if ENABLED (JERRY_ESNEXT)
const uint32_t required_args_number = 1;
#else /* !ENABLED (JERRY_ESNEXT) */
const uint32_t required_args_number = 2;
#endif /* ENABLED (JERRY_ESNEXT) */
if (args_number < required_args_number)
{
/* Note:
* When the UTC function is called with fewer than two arguments,