Timothy Flynn
d1ed361239
LibJS: Cache the result of parsing time zone identifiers
...
The result of parsing an identifier cannot change. It is not cheap to do
so, so let's cache the result.
This is hammered in a few test262 tests. On my machine, this reduces the
runtime of each test/staging/sm/Date/dst-offset-caching-{N}-of-8.js by
0.3 to 0.5 seconds. For example:
dst-offset-caching-1-of-8.js: Reduces from 1.2s -> 0.9s
dst-offset-caching-3-of-8.js: Reduces from 1.5s -> 1.1s
2026-02-19 09:20:15 +01: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:
https://github.com/tc39/proposal-temporal/commit/978311d
2026-02-14 19:47:29 +01:00
Timothy Flynn
a8345693aa
LibJS: Avoid "or if" in if-clauses in Temporal
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/e85b20b
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:
https://github.com/tc39/proposal-temporal/commit/5b02980
2026-02-14 19:47:29 +01:00
Timothy Flynn
d9ce90978c
LibJS: Use = for Temporal mathematical value and BigInt comparisons
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/67ca9de
2026-02-14 19:47:29 +01:00
Timothy Flynn
25ac3d2403
LibJS: Adjust language around Temporal list lengths
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/1e043d6
2026-02-14 19:47:29 +01:00
Timothy Flynn
f3f8311462
LibJS: Prefer "a new empty List" instead of "an empty List" in Temporal
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/c538d83
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
1d8e03b236
LibJS: Remove redundant "the value of x" in Temporal operations
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/09e36d3
2026-02-14 19:47:29 +01:00
Timothy Flynn
ececb8c38c
LibJS: Improve note about precise division in NudgetToCalendarUnit
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/0e8220c
2026-02-14 19:47:29 +01:00
Timothy Flynn
46c864fdd3
LibJS: Remove an unreachable path in Temporal's TimeZoneEquals AO
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/a3cb4bb
2026-02-14 19:47:29 +01:00
Timothy Flynn
e73b54532f
LibJS: Refactor CalendarResolveFields parallel to NonISOResolveFields
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/b2e8299
2026-02-14 19:47:29 +01:00
Timothy Flynn
74048336df
LibJS: Remove else clauses after early returns in Temporal operations
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/e6e031f
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:
https://github.com/tc39/proposal-temporal/commit/1ae3e42
2026-02-14 19:47:29 +01:00
Timothy Flynn
1fdcb5cfe5
LibJS: Fix typo in ToTemporalMonthDay
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/56828a2
2026-02-14 19:47:29 +01:00
Timothy Flynn
fc997d74cb
LibJS: Update spec numbers for Intl Temporal operations
...
Several Intl overrides were removed from the Temporal proposal some time
ago. See:
https://github.com/tc39/proposal-temporal/commit/c08f6a8
https://github.com/tc39/proposal-temporal/commit/87ba571
https://github.com/tc39/proposal-temporal/commit/b52e320
https://github.com/tc39/proposal-temporal/commit/686b216
https://github.com/tc39/proposal-temporal/commit/b125fce
2026-02-14 19:47:29 +01:00
Timothy Flynn
ef1b4a4d57
LibJS: Forbid adding/subtracting non-year/month units in PlainYearMonth
...
This is a normative change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/41faca4
2026-01-30 08:01:45 +01:00
Timothy Flynn
7ac2e7deea
LibJS: Split ISODateSurpasses into a couple of AOs
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/196a319
2026-01-30 08:01:45 +01:00
Timothy Flynn
eff429d490
Revert "LibJS: Move ambiguous time string handling to a separate parser"
...
This reverts commit 3f75cf270a .
This change was meant to be editorial, but it caused a regression. See:
https://github.com/tc39/proposal-temporal/commit/3ffa677
A separate test was not added here to catch this regression, because it
affects non-ISO-8601 calendars, which we do not yet implement.
2026-01-30 08:01:45 +01:00
Timothy Flynn
3fb0e69c20
LibJS: Flip validity check to an assertion in CalendarMonthDayFromFields
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/163d589
2026-01-16 14:31:31 +01:00
Timothy Flynn
076bbd4c33
LibJS: Hoist early return in CalendarDateUntil to the top
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/264e4b8
2026-01-16 14:31:31 +01:00
Timothy Flynn
6cd765c19c
LibJS: Flip validity check to an assertion in IsValidDuration
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/e65f411
2026-01-16 14:31:31 +01:00
Luke Wilde
f77b72040e
LibJS/Temporal: Implement finding time zone transitions
2026-01-16 07:00:02 -05:00
Timothy Flynn
b517e5b947
LibJS: Avoid sign negations in Temporal's DifferenceZonedDateTime
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/407fa01
2026-01-13 13:02:22 -05:00
Timothy Flynn
3eabdcf460
LibJS: Replace Temporal's BalanceISODate with AddDaysToISODate
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/b28ef08
2026-01-13 13:02:22 -05:00
Timothy Flynn
37f49d5f6d
LibJS: Use nanoseconds to normalize values in IsValidDuration
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/68004cc
https://github.com/tc39/proposal-temporal/commit/a6043aa
https://github.com/tc39/proposal-temporal/commit/1962c8b
Note that we were already performing this calculation using nanoseconds.
2025-11-21 13:52:55 +01:00
Timothy Flynn
8feabc3158
LibJS: Re-order infallible operations in GetDifferenceSettings
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/c11021a
2025-11-21 13:52:55 +01:00
Timothy Flynn
54b9ddcc80
LibJS: Use relative date in NudgeToCalendarUnit when comparing durations
...
This is a normative change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/17e12be
The test added here would previously crash.
2025-11-20 08:28:51 -05: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
5c0fdd371a
LibJS: Mark invocation to ParseMonthCode as infallible
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/c1f7bd5
Note the related assertion here was a bit silly. It was effectively:
if (!cond) { return; }
VERIFY(cond);
2025-11-12 16:20:04 -05:00
Timothy Flynn
041c4f4c79
LibJS: Remove unnecessary Temporal month code check
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/9110854
This change actually exposed a bug in our validator for month codes
(which is only used by this same function). We would previously allow
"M00" as a month code, which is invalid (it must be "M00L").
2025-11-12 16:20:04 -05:00
Timothy Flynn
bf3481b301
LibJS: Explicitly state integer limits for UTC offset minutes and ns
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/1fdf09a
Note that the integer limits in the above commit are in spec headers,
which we don't copy to our implementation.
2025-11-12 16:20:04 -05:00
Timothy Flynn
462e7b0c87
LibJS: Introduce Time Zone Identifier Parse Records to Temporal
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/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
aff642053a
LibJS: Set day field in CalendarYearMonthFromFields before resolution
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/a8d38c6
2025-11-06 13:47:11 -05:00
Timothy Flynn
cb6ca85564
LibJS: Handle relativeTo ZDTs that fall within second DST wallclock time
...
This is a normative change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/1a089eb
2025-09-28 11:33:43 -04:00
Timothy Flynn
5bd867f1dc
LibJS: Revert inadvertent observable Temporal change
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/6274e5d
2025-09-19 11:24:02 -04:00
Timothy Flynn
2fa6655dcb
LibJS: Ensure NudgeToCalendarUnit is given a non-zero duration sign
...
Otherwise, we trip internal Temporal spec assertions.
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/30f8575
2025-08-29 01:14:20 +02:00
Timothy Flynn
0c038bf12e
LibJS: Read user options in a Temporal AO sooner
...
This is a normative change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/9924aa4
2025-08-29 01:14:20 +02:00
Timothy Flynn
355589a89e
LibJS: Read user options in some Temporal toString methods sooner
...
This is a normative change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/3eaaadf
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:
https://github.com/tc39/proposal-temporal/commit/28357ea
https://github.com/tc39/proposal-temporal/commit/32f4b02
https://github.com/tc39/proposal-temporal/commit/f860ac6
https://github.com/tc39/proposal-temporal/commit/e6f565d
2025-08-14 11:35:28 -04:00
Timothy Flynn
0f4d5d3abc
LibJS: Remove no-op call to ValidateTemporalUnitValue
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/07c924b
2025-08-14 11:35:28 -04:00
Timothy Flynn
70db474cf0
LibJS+LibWeb: Port interned bytecode strings to UTF-16
...
This was almost a no-op, except we intern JS exception messages. So the
bulk of this patch is porting exception messages to UTF-16.
2025-08-14 10:27:08 +02:00
Timothy Flynn
3920194bca
LibJS: Move regulating and balancing logic into ISODateSurpasses
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/eddb77f
2025-08-05 11:18:08 -04:00
Timothy Flynn
a95d3e2a5e
LibJS: Split ISO and non-ISO Temporal calendar operations
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/47042f2
2025-08-05 11:18:08 -04:00
Timothy Flynn
0efa98a57a
LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16
...
This has quite a lot of fall out. But the majority of it is just type or
UDL substitution, where the changes just fall through to other function
calls.
By changing property key storage to UTF-16, the main affected areas are:
* NativeFunction names must now be UTF-16
* Bytecode identifiers must now be UTF-16
* Module/binding names must now be UTF-16
2025-08-05 07:07:15 -04:00
Timothy Flynn
b3d52a8238
LibJS: Compute offsetBehaviour in ToTemporalZonedDateTime after parsing
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/4b83ba3
2025-07-23 22:05:15 +02:00
Timothy Flynn
e95f225362
LibJS: Correctly disallow certain calendar-based Temporal strings
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/d83241f
2025-07-23 22:05:15 +02:00