Fix Date construct helper
Correct behaviour of step 8, 15.9.3.1, ECMA-262 v5.1. - Change ToInt32(y) to ToInteger(y). - If ToInteger(y) is not between 0 and 99 then yr = y Related issue: #1071 JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
This commit is contained in:
@@ -136,18 +136,14 @@ ecma_date_construct_helper (const ecma_value_t *args, /**< arguments passed to t
|
||||
|
||||
if (ecma_is_value_empty (ret_value))
|
||||
{
|
||||
if (!ecma_number_is_nan (year) && !ecma_number_is_infinity (year))
|
||||
if (!ecma_number_is_nan (year))
|
||||
{
|
||||
/* 8. */
|
||||
int32_t y = ecma_number_to_int32 (year);
|
||||
ecma_number_t y = ecma_number_trunc (year);
|
||||
|
||||
if (y >= 0 && y <= 99)
|
||||
{
|
||||
year = (ecma_number_t) (1900 + y);
|
||||
}
|
||||
else
|
||||
{
|
||||
year = (ecma_number_t) y;
|
||||
year = 1900 + y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user