The ecma_date_make_day() handled any date in October on leap years incorrectly, which was mentioned in issue #1836. The ecma_date_week_day() returned minus values when return week_day before 1970 years which was also incorrect. This change solves these bugs. In addition, this enhances the algorithm of accessing 'the ym-mn-1' by replacing binary search to simple computation at ecma_date_make_day(). JerryScript-DCO-1.0-Signed-off-by: Hayun Lee lhy920806@gmail.com
This commit is contained in:
@@ -162,6 +162,8 @@ main ()
|
||||
TEST_ASSERT (ecma_date_make_day (1970, 1, 35) == 65);
|
||||
TEST_ASSERT (ecma_date_make_day (1970, 13, 35) == 430);
|
||||
TEST_ASSERT (ecma_date_make_day (2016, 2, 1) == 16861);
|
||||
TEST_ASSERT (ecma_date_make_day (2016, 8, 31) == 17075);
|
||||
TEST_ASSERT (ecma_date_make_day (2016, 9, 1) == 17075);
|
||||
|
||||
/* ecma_number_t ecma_date_make_date (day, time) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user