1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-03 05:32:13 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins/Date
Timothy Flynn d83ce7dd0b LibJS: Re-implement the Date constructor / prototype for spec compliance
First, this adds a constructor to the Date object to be created from a
plain double. This is a first step to removing Core::DateTime as the
basis for the Date object. A subsequent commit will remove the now-
unused data from the object.

Next, this implements the constructor in accordance to the spec. The
constructor when NewTarget is undefined no longer allocates a Date on
the heap. The other constructor properly uses recently created AOs to
handle time zone and ensure the created [[DateValue]] is valid. Other
methods on the constructor (Date.now) have not been touched yet.

Last, the prototype is reimplemented. Again, we use other AOs to handle
time zones and time clipping. Not all prototypes are fixed; most of them
are, but a few (e.g. Date.prototype.getTimezoneOffset) were not fixed,
but left in a mostly unimplemented state for another commit.

In all of the above, spec comments are added. This is a rather large
change; but it's tough to do any of these parts individually without
breaking everything else.
2022-01-15 20:13:48 +01:00
..
Date.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.now.js LibJS: Make Date.now() return a floor()'d milliseconds value 2021-07-10 19:51:07 +01:00
Date.parse.js LibJS: Clip parsed IS0 8601 strings to +/- 8.64e15 2022-01-14 22:39:06 +01:00
Date.prototype.getDate.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getDay.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getFullYear.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getHours.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getMilliseconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getMinutes.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getMonth.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getSeconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getTime.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCDate.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCDay.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCFullYear.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCHours.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCMilliseconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCMinutes.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCMonth.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.getUTCSeconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.setDate.js LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Date.prototype.setFullYear.js LibJS: Account for differences in month representations (0-11 vs 1-12) 2021-06-06 19:14:11 +01:00
Date.prototype.setHours.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.setMilliseconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.setMinutes.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.setMonth.js LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Date.prototype.setSeconds.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.setTime.js LibJS: Add Date.prototype.setTime() 2021-06-06 19:14:11 +01:00
Date.prototype.toISOString.js LibJS Date: Added "Invalid Date". 2021-03-22 20:58:22 +01:00
Date.prototype.toLocaleDateString.js LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Date.prototype.toLocaleString.js LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Date.prototype.toLocaleTimeString.js LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Date.prototype.toTemporalInstant.js LibJS: Change wording of ErrorType::NotA to be independent of context 2021-09-12 00:16:39 +02:00
Date.UTC.js LibJS: Implement Date.UTC according to the spec 2022-01-05 20:05:12 +01:00