Commit graph

19 commits

Author SHA1 Message Date
Timothy Flynn
8f51d1dd04 LibJS: Integrate Temporal.Duration into Intl.DurationFormat
This is a normative change in the Temporal proposal. See:
2d97205
2025-03-01 14:49:20 +01:00
Timothy Flynn
f16fe66def LibJS: Migrate IsValidDuration to ECMA-262
This is an editorial change in the Temporal proposal. See:
03770bb

Note: We were actually already using the Temporal definition of this AO
in Intl.DurationFormat, so there's no change needed there.
2025-03-01 14:49:20 +01:00
Timothy Flynn
0e81092685 LibJS: Make CombineDateAndTimeDuration infallible
This is an editorial change in the Temporal proposal. See:
794960c
2024-12-05 15:29:08 -05:00
Timothy Flynn
46c3406008 LibJS: Swap arguments in invocation to AddTimeDurationToEpochNanoseconds
This is an editorial change in the Temporal proposal. See:
630b043

This also changes the second argument of this AO to not use the alias of
TimeDuration, as that should not be used to refer to epoch nanoseconds.
This was missed in commit 2d9405e5d7.
2024-12-05 15:29:08 -05:00
Timothy Flynn
713e86cc1d LibJS: Mark some AO invocations in the Nudge* AOs as infallible
These are editorial changes in the Temporal proposal. See:
7aef51e
35cc12d
2637ba5
76dc52f
034f756
2024-12-05 15:29:08 -05:00
Timothy Flynn
4cbb5661d0 LibJS: Make ToDateDurationRecordWithoutTime infallible
This is an editorial change in the Temporal proposal. See:
05017b9
2024-12-05 15:29:08 -05:00
Timothy Flynn
2d9405e5d7 LibJS: Use the TimeDuration alias a bit less in Temporal
It was a bit of a semantic mistake too use this alias too eagerly.
Namely, it should not be used to refer to epoch nanoseconds. We now only
use the TimeDuration alias where the spec refers to a value as a time
duration.
2024-11-26 11:35:15 -05:00
Timothy Flynn
d0149d8fc0 LibJS: Begin implementing the relativeTo option of Duration.total 2024-11-23 14:46:00 +01:00
Timothy Flynn
0befd52725 LibJS: Begin implementing the relativeTo option of Duration.compare 2024-11-23 14:46:00 +01:00
Timothy Flynn
35f22dcf79 LibJS: Implement Temporal.PlainYearMonth.prototype.add/subtract 2024-11-22 19:55:24 +01:00
Timothy Flynn
cb5d1b5086 LibJS: Implement Temporal.PlainYearMonth.prototype.until/since 2024-11-22 19:55:24 +01:00
Timothy Flynn
5689621c2b LibJS: Implement Temporal.Duration.prototype.round
Until we have re-implemented Temporal.PlainDate/ZonedDateTime, some of
Temporal.Duration.prototype.round (and its invoked AOs) are left
unimplemented.
2024-11-20 19:04:30 -05:00
Timothy Flynn
4742775262 LibJS: Implement stringification Temporal.Duration prototypes 2024-11-20 19:04:30 -05:00
Timothy Flynn
a80523be18 LibJS: Implement mathematical Temporal.Duration prototypes
Includes:
Temporal.Duration.prototype.negated
Temporal.Duration.prototype.abs
Temporal.Duration.prototype.add
Temporal.Duration.prototype.subtract
2024-11-20 19:04:30 -05:00
Timothy Flynn
5fe0d3352d LibJS: Implement the Temporal.Duration constructor
This also includes a stubbed Temporal.Duration.prototype.

Until we have re-implemented Temporal.PlainDate/ZonedDateTime, some of
Temporal.Duration.compare (and its invoked AOs) are left unimplemented.
2024-11-20 19:04:30 -05:00
Timothy Flynn
c8d2404230 LibJS: Update spec steps for the few remaining Temporal AOs 2024-11-20 19:04:30 -05:00
Timothy Flynn
f7517c5b8d LibJS: Remove our existing Temporal implementation
Our Temporal implementation is woefully out of date. The spec has been
so vastly rewritten that it is unfortunately not practical to update our
implementation in-place. Even just removing Temporal objects that were
removed from the spec, or updating any of the simpler remaining objects,
has proven to be a mess in previous attempts.

So, this removes our Temporal implementation. AOs used by other specs
are left intact.
2024-11-20 19:04:30 -05:00
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp (Browse further)