Fix failing Date tests in test262-esnext (#4561)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
This commit is contained in:
@@ -445,7 +445,13 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
|||||||
#if JERRY_BUILTIN_ANNEXB
|
#if JERRY_BUILTIN_ANNEXB
|
||||||
case ECMA_DATE_PROTOTYPE_SET_YEAR:
|
case ECMA_DATE_PROTOTYPE_SET_YEAR:
|
||||||
{
|
{
|
||||||
year = converted_number[0];
|
if (ecma_number_is_nan (converted_number[0]))
|
||||||
|
{
|
||||||
|
*ECMA_GET_INTERNAL_VALUE_POINTER (ecma_number_t, ext_object_p->u.class_prop.u.value) = converted_number[0];
|
||||||
|
return ecma_make_number_value (converted_number[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
year = ecma_number_trunc (converted_number[0]);
|
||||||
if (year >= 0 && year <= 99)
|
if (year >= 0 && year <= 99)
|
||||||
{
|
{
|
||||||
year += 1900;
|
year += 1900;
|
||||||
@@ -478,8 +484,6 @@ ecma_builtin_date_prototype_dispatch_set (uint16_t builtin_routine_id, /**< buil
|
|||||||
#if JERRY_BUILTIN_ANNEXB
|
#if JERRY_BUILTIN_ANNEXB
|
||||||
if (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_YEAR)
|
if (builtin_routine_id == ECMA_DATE_PROTOTYPE_SET_YEAR)
|
||||||
{
|
{
|
||||||
builtin_routine_id = ECMA_DATE_PROTOTYPE_SET_UTC_YEAR;
|
|
||||||
|
|
||||||
if (ecma_number_is_nan (converted_number[0]))
|
if (ecma_number_is_nan (converted_number[0]))
|
||||||
{
|
{
|
||||||
day_part = 0;
|
day_part = 0;
|
||||||
|
|||||||
@@ -837,7 +837,7 @@ ecma_date_value_to_iso_string (ecma_number_t datetime_number) /**<datetime */
|
|||||||
ecma_value_t
|
ecma_value_t
|
||||||
ecma_date_value_to_date_string (ecma_number_t datetime_number) /**<datetime */
|
ecma_date_value_to_date_string (ecma_number_t datetime_number) /**<datetime */
|
||||||
{
|
{
|
||||||
return ecma_date_to_string_format (datetime_number, "$Y-$O-$D");
|
return ecma_date_to_string_format (datetime_number, "$W $M $D $Y");
|
||||||
} /* ecma_date_value_to_date_string */
|
} /* ecma_date_value_to_date_string */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -852,7 +852,7 @@ ecma_date_value_to_date_string (ecma_number_t datetime_number) /**<datetime */
|
|||||||
ecma_value_t
|
ecma_value_t
|
||||||
ecma_date_value_to_time_string (ecma_number_t datetime_number) /**<datetime */
|
ecma_date_value_to_time_string (ecma_number_t datetime_number) /**<datetime */
|
||||||
{
|
{
|
||||||
return ecma_date_to_string_format (datetime_number, "$h:$m:$s.$i");
|
return ecma_date_to_string_format (datetime_number, "$h:$m:$s GMT$z$Z");
|
||||||
} /* ecma_date_value_to_time_string */
|
} /* ecma_date_value_to_time_string */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ assert (date.toUTCString() === "Wed, 12 Aug 2015 09:40:20 GMT");
|
|||||||
assert (date.toISOString() === "2015-08-12T09:40:20.000Z");
|
assert (date.toISOString() === "2015-08-12T09:40:20.000Z");
|
||||||
|
|
||||||
assert (new Date (NaN).toDateString () == "Invalid Date");
|
assert (new Date (NaN).toDateString () == "Invalid Date");
|
||||||
assert (new Date ("2015-02-13").toDateString () == "2015-02-13");
|
assert (new Date ("2015-02-13").toDateString () == "Fri Feb 13 2015");
|
||||||
assert (new Date ("2015-07-08T11:29:05.023").toDateString () == "2015-07-08");
|
assert (new Date ("2015-07-08T11:29:05.023").toDateString () == "Wed Jul 08 2015");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -58,8 +58,8 @@ catch (e)
|
|||||||
|
|
||||||
assert (new Date (NaN).toTimeString () == "Invalid Date");
|
assert (new Date (NaN).toTimeString () == "Invalid Date");
|
||||||
assert (new Date (Number.POSITIVE_INFINITY).toString () === "Invalid Date");
|
assert (new Date (Number.POSITIVE_INFINITY).toString () === "Invalid Date");
|
||||||
assert (new Date ("2015-02-13").toTimeString () == "00:00:00.000");
|
assert (new Date ("2015-02-13").toTimeString () == "00:00:00 GMT+0000");
|
||||||
assert (new Date ("2015-07-08T11:29:05.023").toTimeString () == "11:29:05.023");
|
assert (new Date ("2015-07-08T11:29:05.023").toTimeString () == "11:29:05 GMT+0000");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,9 +28,6 @@
|
|||||||
<test id="built-ins/BigInt/asUintN/length.js"><reason></reason></test>
|
<test id="built-ins/BigInt/asUintN/length.js"><reason></reason></test>
|
||||||
<test id="built-ins/BigInt/asUintN/name.js"><reason></reason></test>
|
<test id="built-ins/BigInt/asUintN/name.js"><reason></reason></test>
|
||||||
<test id="built-ins/BigInt/asUintN/order-of-steps.js"><reason></reason></test>
|
<test id="built-ins/BigInt/asUintN/order-of-steps.js"><reason></reason></test>
|
||||||
<test id="built-ins/Date/prototype/toDateString/format.js"><reason></reason></test>
|
|
||||||
<test id="built-ins/Date/prototype/toDateString/negative-year.js"><reason></reason></test>
|
|
||||||
<test id="built-ins/Date/prototype/toTimeString/format.js"><reason></reason></test>
|
|
||||||
<test id="built-ins/Function/prototype/toString/AsyncFunction.js"><reason></reason></test>
|
<test id="built-ins/Function/prototype/toString/AsyncFunction.js"><reason></reason></test>
|
||||||
<test id="built-ins/Function/prototype/toString/Function.js"><reason></reason></test>
|
<test id="built-ins/Function/prototype/toString/Function.js"><reason></reason></test>
|
||||||
<test id="built-ins/Function/prototype/toString/GeneratorFunction.js"><reason></reason></test>
|
<test id="built-ins/Function/prototype/toString/GeneratorFunction.js"><reason></reason></test>
|
||||||
@@ -553,10 +550,6 @@
|
|||||||
<!-- AnnexB - Additional ECMAScript Features for Web Browsers
|
<!-- AnnexB - Additional ECMAScript Features for Web Browsers
|
||||||
https://www.ecma-international.org/ecma-262/11.0/#sec-additional-ecmascript-features-for-web-browsers
|
https://www.ecma-international.org/ecma-262/11.0/#sec-additional-ecmascript-features-for-web-browsers
|
||||||
-->
|
-->
|
||||||
<test id="annexB/built-ins/Date/prototype/setYear/this-time-nan.js"><reason></reason></test>
|
|
||||||
<test id="annexB/built-ins/Date/prototype/setYear/this-time-valid.js"><reason></reason></test>
|
|
||||||
<test id="annexB/built-ins/Date/prototype/setYear/year-number-absolute.js"><reason></reason></test>
|
|
||||||
<test id="annexB/built-ins/Date/prototype/setYear/year-number-relative.js"><reason></reason></test>
|
|
||||||
<test id="annexB/built-ins/Function/createdynfn-html-close-comment-body.js"><reason></reason></test>
|
<test id="annexB/built-ins/Function/createdynfn-html-close-comment-body.js"><reason></reason></test>
|
||||||
<test id="annexB/built-ins/Function/createdynfn-html-close-comment-params.js"><reason></reason></test>
|
<test id="annexB/built-ins/Function/createdynfn-html-close-comment-params.js"><reason></reason></test>
|
||||||
<test id="annexB/built-ins/Function/createdynfn-html-open-comment-body.js"><reason></reason></test>
|
<test id="annexB/built-ins/Function/createdynfn-html-open-comment-body.js"><reason></reason></test>
|
||||||
|
|||||||
Reference in New Issue
Block a user