Timothy Flynn
2e74b91ca1
LibJS: Pass calendar strings around as String more regularly
...
Same as commit f9fa548d43 .
These are String from the outset, so this patch is almost entirely just
changing function parameter types. This will allow us to cache calendar
objects in ICU without invoking any extra allocations.
2026-03-09 11:40:59 +01:00
Shannon Booth
502ae99102
LibJS: Make more use of Value::is and Value::as_if
2026-02-28 10:24:37 -05:00
Timothy Flynn
6e433f0d10
LibJS: Use infallible time zone parser in a couple more locations
2026-02-19 09:20:15 +01:00
Timothy Flynn
f9fa548d43
LibJS: Pass time zone strings around as String more regularly
...
These are String from the outset, so this patch is almost entirely just
changing function parameter types. This will allow us to cache time zone
parse results without invoking any extra allocations.
2026-02-19 09:20:15 +01:00
Timothy Flynn
206a18acd4
LibJS: Use single-line if/else steps in Temporal operations
...
This is an editorial change in the Temporal proposal. See:
978311d
2026-02-14 19:47:29 +01:00
Timothy Flynn
78ff593cc8
LibJS: Use "either" / "one of" when comparing multiple items in Temporal
...
This is an editorial change in the Temporal proposal. See:
5b02980
2026-02-14 19:47:29 +01:00
Timothy Flynn
dde73e9eb7
LibJS: Remove editor's note from Temporal's ISODateToEpochDays
...
We don't tend to copy these as they won't appear in the final spec.
(These note types are different than the standard NOTE: signifiers.)
2026-02-14 19:47:29 +01:00
Timothy Flynn
8c5fd82da9
LibJS: Replace "otherwise" with "else" in Temporal operations
...
This is an editorial change in the Temporal proposal. See:
1ae3e42
2026-02-14 19:47:29 +01:00
Timothy Flynn
8feabc3158
LibJS: Re-order infallible operations in GetDifferenceSettings
...
This is an editorial change in the Temporal proposal. See:
c11021a
2025-11-21 13:52:55 +01:00
Timothy Flynn
c7e4a99219
LibJS: Handle negativity in Temporal's ApplyUnsignedRoundingMode
...
I don't fully understand the BigInt math here, as the computation for
d1 and d2 don't align with the spec due to BigInt logic. This was
discussed a bit in SerenityOS's Discord some years ago:
https://discord.com/channels/830522505605283862/851522357734408232/978786665306918932
But some new tests in test262 indicate that we need to handle negative
values here, instead of just throwing away the sign.
2025-11-14 06:32:49 -05:00
Psychpsyo
100f37995f
Everywhere: Clean up AD-HOC and FIXME comments without colons
2025-11-13 15:56:04 +01:00
Timothy Flynn
462e7b0c87
LibJS: Introduce Time Zone Identifier Parse Records to Temporal
...
This is an editorial change in the Temporal proposal. See:
96bb9b0
Note that we already had a struct for this, but now that it has a proper
name and spec link, this renames it to match other Parse Records and
places it alongside them.
2025-11-12 16:20:04 -05:00
Timothy Flynn
0c038bf12e
LibJS: Read user options in a Temporal AO sooner
...
This is a normative change in the Temporal proposal. See:
9924aa4
2025-08-29 01:14:20 +02:00
Timothy Flynn
e314ca5e9d
LibJS: Introduce ParseMonthCode and CreateMonthCode Temporal AOs
...
This is an editorial change in the Temporal proposal. See:
28357ea
32f4b02
f860ac6
e6f565d
2025-08-14 11:35:28 -04:00
Timothy Flynn
e95f225362
LibJS: Correctly disallow certain calendar-based Temporal strings
...
This is an editorial change in the Temporal proposal. See:
d83241f
2025-07-23 22:05:15 +02:00
Timothy Flynn
3b3ff6f057
LibJS: Split up the GetTemporalUnitValuedOption AO
...
This is an editorial change in the Temporal proposal. See:
fcdb47e
ef04774
2070032
adf50d4
40eaeb7
aab7bee
a10d38d
06ce375
2025-07-23 22:05:15 +02:00
Timothy Flynn
c8b4dc4847
LibJS: Require strict matching with a precise ZonedDateTime offset
...
This is a normative change in the Temporal proposal. See:
1117eaf
2025-06-03 09:09:21 +12:00
devgianlu
5f1a30197c
LibCrypto: Remove the concept of invalid big integers
...
This concept is rarely used in codebase and very much error-prone
if you forget to check it.
Instead, make it so that operations that would produce invalid integers
return an error instead.
2025-04-28 12:05:26 +02:00
Timothy Flynn
a8d6e5c3db
LibJS: Migrate Temporal updates to ECMA-262 AOs to the main AO file
...
These are going to be included in the ECMA-262 AOs once Temporal reaches
stage 4. There's no need to keep them in the Temporal namespace. Some
upcoming Temporal editorial changes will get awkward without this patch.
2025-03-01 14:49:20 +01:00
Timothy Flynn
ea52952774
LibJS: Update Date AOs to use Temporal
...
Neglected to do this after the Temporal rewrite. This lets us eliminate
the duplicated GetUTCEpochNanoseconds definition in Temporal.
2025-03-01 14:49:20 +01:00
Timothy Flynn
5372d07c5c
LibJS: Simplify ParseTemporalCalendarString
...
This is an editorial change in the Temporal proposal. See:
1b1fd9f
2025-01-28 11:25:42 +00:00
Timothy Flynn
784e872851
LibJS: Remove errant assertion from ParseISODateTime
...
This is an editorial change in the Temporal proposal. See:
728beeb
2024-12-05 15:29:08 -05:00
Timothy Flynn
fe4995b69a
LibJS: Replace invalid reference to an [[Offset]] internal slot
...
This is an editorial change in the Temporal proposal. See:
f1569ef
Here, we also update the struct member name to match the correct slot
name.
2024-12-05 15:29:08 -05:00
Timothy Flynn
ade510fe17
LibJS: Pass ISO types by value vs. const-reference more correctly
...
We were passing types like ISODate by reference so that they could be
used as forward-declarations. But after commit 021a5f4ded , we now have
their full definitions anywhere they're needed. So let's pass ISODate by
value everywhere consistently - it is only 8 bytes.
2024-11-26 11:35:15 -05:00
Timothy Flynn
b95528d7b5
LibJS: Stub out Temporal.ZonedDateTime.prototype.getTimeZoneTransition
...
We will have to add facilities to determine next/previous time zone
transitions. Ideally, ICU can provide this.
2024-11-26 11:00:56 +01:00
Timothy Flynn
4ef21614e9
LibJS: Implement stringification Temporal.ZonedDateTime prototypes
2024-11-26 11:00:56 +01:00
Timothy Flynn
18f95434bc
LibJS: Implement the Temporal.Duration relative-to ZonedDateTime options
2024-11-26 11:00:56 +01:00
Timothy Flynn
8c73cae2b8
LibJS: Implement the Temporal.ZonedDateTime constructor
...
And the simple Temporal.ZonedDateTime.prototype getters, so that the
constructed Temporal.ZonedDateTime may actually be validated.
2024-11-26 11:00:56 +01:00
Timothy Flynn
615ad70030
LibJS: Implement stringification Temporal.Instant prototypes
2024-11-25 13:32:58 +01:00
Timothy Flynn
90820873a2
LibJS: Implement the Temporal.Instant constructor
...
And the simple Temporal.Instant.prototype getters, so that the
constructed Temporal.Instant may actually be validated.
2024-11-25 13:32:58 +01:00
Timothy Flynn
029b6ad1a8
LibJS: Implement the Temporal.PlainDateTime constructor
...
And the simple Temporal.PlainDateTime.prototype getters, so that the
constructed Temporal.PlainDateTime may actually be validated.
2024-11-24 11:43:59 +01:00
Timothy Flynn
66365fef57
LibJS: Implement the Temporal.PlainTime constructor
...
And the simple Temporal.PlainTime.prototype getters, so that the
constructed Temporal.PlainTime may actually be validated.
2024-11-23 19:35:36 -05:00
Timothy Flynn
7f3de3be9c
LibJS: Capture sub-second nanoseconds as a u64 in FormatTimeString
...
This is not a plain nanosecond value (which has a range of [0, 999]).
Rather, it is all of the sub-second components added together.
2024-11-23 19:35:36 -05:00
Timothy Flynn
0b59971ef9
LibJS: Reject ambiguous annotated time strings
...
This missing rejection will be caught by an upcoming Temporal.PlainTime
test.
2024-11-23 19:35:36 -05:00
Timothy Flynn
c83a3db542
LibJS: Handle Temporal.PlainDate in dynamic calendar operations
2024-11-23 19:35:36 -05:00
Timothy Flynn
06593b1894
LibJS: Implement most of GetTemporalRelativeToOption
...
Now that we have the Temporal.PlainDate object, we can flesh out this AO
for such relative-to objects.
2024-11-23 14:46:00 +01:00
Timothy Flynn
021a5f4ded
LibJS: Move ISO-related structures to their own file
...
Currently, AbstractOperations.h needs to include Time.h for the Time
structure. Soon, Time.h will need to include AbstractOperations.h for
structures defined there. To avoid a circular include, let's put the
ISO types into their own file, so that AO.h does not need to include
any JS type header.
2024-11-23 14:46:00 +01:00
Timothy Flynn
abc6b679c3
LibJS: Check both the quotient and remainder for rounding negativity
...
Our BigInt implementation can store the negativity of the division
result in either the quotient or the remainder. This is exposed by an
upcoming prototype, which will reach this division with:
-432000000000000 / 86400000000000000000000
Which has the BigInt division result:
quotient = 0
remainder = -432000000000000
(Our old Temporal implementation also had this bug).
2024-11-23 14:46:00 +01:00
Timothy Flynn
cb5d1b5086
LibJS: Implement Temporal.PlainYearMonth.prototype.until/since
2024-11-22 19:55:24 +01:00
Timothy Flynn
b68d67693e
LibJS: Implement the Temporal.PlainYearMonth constructor
...
And the simple Temporal.PlainYearMonth.prototype getters, so that the
constructed Temporal.PlainYearMonth may actually be validated.
2024-11-22 19:55:24 +01:00
Timothy Flynn
c6fccc04e1
LibJS: Use Temporal's ISO8601 parser to parse UTC offset strings
...
We now have the Temporal facilities to implement the Date AOs which
parse UTC offset strings using the ISO8601 parser. This patch updates
those AOs and their callers in accordance with the Temporal spec.
2024-11-21 19:24:25 -05:00
Timothy Flynn
5389acc231
LibJS: Implement Temporal.PlainMonthDay.prototype.with/equals
2024-11-21 19:24:25 -05:00
Timothy Flynn
5bccb36a6f
LibJS: Implement stringification Temporal.PlainMonthDay prototypes
2024-11-21 19:24:25 -05:00
Timothy Flynn
1a386e78c3
LibJS: Implement the Temporal.PlainMonthDay constructor
...
And the simple Temporal.PlainMonthDay.prototype getters, so that the
constructed Temporal.PlainMonthDay may actually be validated.
2024-11-21 19:24:25 -05: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
e4e05837e1
LibJS: Return a GC::Ref from Temporal::get_options_object
...
The Object returned here is always non-null.
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