jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

Fix issues in the Date constructor

Open kkristof opened this issue 11 years ago • 3 comments

There are some bugs in the date constructor. The following cases produce wrong Date objects: This should be invalid but it is valid:

d = new Date(8.64e+15 + 1);

The first one should be valid while the second one should be invalid:

d = new Date("275760-09-13T00:00:00.000");
d = new Date("275760-09-13T00:00:00.001");

This should be valid:

d = new Date("300-09-13T00:00:00.000");

kkristof avatar Jul 27 '15 08:07 kkristof

cc: @szledan @LaszloLango

kkristof avatar Jul 27 '15 08:07 kkristof

According to the standard (15.9.1.15) the date string contains strictly four year digit. However other JS engines support it so I'm going to check how hard would be support this in the Jerry as well.

kkristof avatar Jul 27 '15 09:07 kkristof

The first test case is solved in #490. The support of the different date strings mentioned in the description is postponed until we have more spare time and fewer open issues.

kkristof avatar Jul 29 '15 13:07 kkristof