1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00
serenity/Libraries/LibJS/Tests/builtins
Nico Weber 5f595e7e1b LibC: Make localtime() and gmtime() handle years before 1970
Year computation has to be based on seconds, not days, in case
t is < 0 but t / __seconds_per_day is 0.

Year computation also has to consider negative timestamps.

With this, days is always positive and <= the number of days in the
year, so base the tm_wday computation directly on the timestamp,
and do it first, before t is modified in the year computation.
In C, % can return a negative number if the left operand is negative,
compensate for that.

Tested via test-js. (Except for tm_wday, since we don't implement
Date.prototype.getUTCDate() yet.)
2020-08-23 10:42:37 +02:00
..
Array LibJS: Implement basic functionality of Array.from() 2020-08-17 21:23:11 +02:00
BigInt LibJS: Implement Symbol.toStringTag 2020-07-11 23:13:29 +02:00
Boolean LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
Date LibC: Make localtime() and gmtime() handle years before 1970 2020-08-23 10:42:37 +02:00
Error LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
Function LibJS: Add Symbol.hasInstance tests 2020-07-14 20:15:19 +02:00
functions LibJS: Split isNaN tests into multiple sections 2020-07-06 23:40:35 +02:00
Infinity LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
JSON LibJS: Implement Symbol.toStringTag 2020-07-11 23:13:29 +02:00
Math LibJS: Implement Symbol.toStringTag 2020-07-11 23:13:29 +02:00
NaN LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
Number LibJS: Add Number.prototype.toString 2020-07-15 18:24:55 +02:00
Object LibJS: Implement spec-compliant Object.prototype.toString 2020-07-11 23:13:29 +02:00
Proxy LibJS: Indent tests with 4 spaces instead of 2 2020-07-06 23:40:35 +02:00
Reflect LibJS: Object.preventExtensions should allow property modfication 2020-07-07 10:47:10 +02:00
String LibJS: Implement String.prototype.charCodeAt 2020-07-22 15:48:01 +02:00
Symbol LibJS: Allow conversion from Symbol to String via explicit String() call 2020-08-22 10:52:40 +02:00