Commit graph

178 commits

Author SHA1 Message Date
Timothy Flynn
6a564376fc Meta+LibUnicode+LibJS: Upgrade to ICU 76.1
This updates our local ICU overlay port to use ICU 76.1. This includes
Unicode 16 and CLDR 46.

Upstream vcpkg is not able to supply versions past 74 yet due to various
dependency issues, but we are able to use this version ourselves. The
overlay port now includes a patch to revert ICU's dependence on autoconf
2.72 for now, as this version is not yet available on all systems.

All of the test changes were cross-referenced with Firefox to ensure
correctness.
2025-01-18 17:56:40 -05:00
Timothy Flynn
0763997591 LibJS: Ensure tests using the "ar" locale use the "arab" number system
In ICU 76, the default was changed from "arab" to "latn". See:
c149724509

The whole point of these tests was to use a non-Latin numbering system.
This patch ensures that is the case to make following patches easier to
grok.
2025-01-18 17:56:40 -05:00
Timothy Flynn
26c2484c2f LibJS: Implement the AsyncDisposableStack interface
This is very similar to the DisposableStack interface, except disposal
of resources is promise-based.
2025-01-17 20:46:32 +01:00
Timothy Flynn
59162c8155 LibJS: Adjust ad-hoc clamping behavior in RegulateISODate
Instead of clamping to the limits allowed by ISOYearMonthWithinLimits,
clamp to the limits allowed by the type we are converting to (i32). This
allows some callers to then reject years outside that range.
2025-01-17 10:08:06 +01:00
Timothy Flynn
d5b26183f3 LibJS: Convert errant MUST to TRY in Temporal.PlainDateTime.with 2025-01-17 10:08:06 +01:00
Shannon Booth
5aeae5e583 LibJS: Parse dates like "Wednesday, Jan 15, 2025"
This was getting called on abc.com
2025-01-15 10:42:29 +01:00
Nicolas Ramz
423d106fd8 LibJS: Support date strings of the form "Thu, 09 Jan 2025 23:00:00" 2025-01-08 18:45:43 +01:00
Shannon Booth
c804d08d34 LibJS: Parse dates like "2025-01-02 14:00:00+0000"
This was getting spammed in the console by a website in the wild.
2025-01-03 14:43:13 -08:00
Timothy Flynn
962441b3cf LibJS: Avoid internal assertion accessing detached TA internal slots
This defers accessing TA internal slots until we know we have a valid,
attached TA. Our implementation has assertions that guard against this.
2024-12-13 07:09:39 -08:00
Timothy Flynn
234f218803 LibJS: Ensure GetDateTimeFormat returns nonnull for the best format
This is an editorial change in the Temporal proposal. See:
8a52801
2024-12-06 11:13:10 -05:00
Timothy Flynn
6dfa6993e5 LibJS: Add workaround for invalid ISODateTimes in DifferenceISODateTime
The assertions can be hit when Temporal.Duration.prototype.round / total
are provided a PlainDate at the very limits of valid date-times. Tests
were recently added to test262 which trip these assertions, thus we are
now crashing in those tests. Let's throw a RangeError instead, as this
is the behavior expected by the tests.
2024-12-05 15:29:08 -05:00
Timothy Flynn
db87f173fb LibJS: Implement the RegExp.escape proposal
https://tc39.es/proposal-regex-escaping/
2024-12-05 13:56:21 +01:00
Timothy Flynn
5e534f4d83 LibJS+LibUnicode: Designate a sort order for Intl.PluralRules categories
This is a normative change in the ECMA-402 spec. See:
62fe5db
2024-12-05 09:49:55 +01:00
Timothy Flynn
3c64e4595a LibJS: Use exact mathematical values for Intl.DurationFormat
We can't use doubles due to precision loss for extremely large values.
2024-12-04 08:01:35 -05:00
Timothy Flynn
53a507303c LibJS: Prevent extensions of TypedArray exotic objects
This is a normative change in the ECMA-262 spec. See:
c1040ff
2024-11-30 11:18:26 +01:00
Timothy Flynn
0468463e2e LibJS: Implement the ECMA-402 ZonedDateTime.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
c96f6c396f LibJS: Implement the ECMA-402 PlainDateTime.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
224304cd56 LibJS: Implement the ECMA-402 PlainTime.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
ac0292b18f LibJS: Implement the ECMA-402 PlainYearMonth.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
bca70584b9 LibJS: Implement the ECMA-402 PlainMonthDay.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
697e68e68f LibJS: Implement the ECMA-402 PlainDate.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
964f41bb53 LibJS: Implement the ECMA-402 Instant.prototype.toLocaleString.js 2024-11-29 09:52:12 +01:00
Timothy Flynn
ea503a4f68 LibJS+LibUnicode: Integrate Temporal into Intl.DateTimeFormat
The gist is that we need to construct an ICU date-time formatter for
each possible Temporal type. This is of course going to be expensive.
So instead, we construct the configurations needed for the ICU objects
in the Intl.DateTimeFormat constructor, and defer creating the actual
ICU objects until they are needed.

Each formatting prototype can also now accept either a number (as they
already did), or any of the supported Temporal objects. These types may
not be mixed, and their properties (namely, their calendar) must align
with the Intl.DateTimeFormat object.
2024-11-29 09:52:12 +01:00
Timothy Flynn
fc6155cf2c LibJS: Differentiate between failed ISO8601 parsing and invalid values
If we were able to parse an ISO8601 Date string, but the parse results
in an invalid date (e.g. out of the min/max range), we should abort
parsing immediately.
2024-11-26 15:02:07 -05:00
Timothy Flynn
511029807a LibJS: Implement Date.prototype.toTemporalInstant 2024-11-26 15:02:07 -05:00
Timothy Flynn
7aee254708 LibJS: Use correct epoch offset in InterpretISODateTimeOffset 2024-11-26 15:02:00 -05:00
Timothy Flynn
58828ffd62 LibJS: Implement Temporal.ZonedDateTime.prototype.to*
Includes:

Temporal.ZonedDateTime.prototype.toInstant
Temporal.ZonedDateTime.prototype.toPlainDate
Temporal.ZonedDateTime.prototype.toPlainTime
Temporal.ZonedDateTime.prototype.toPlainDateTime
2024-11-26 11:00:56 +01: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
6d78f1327e LibJS: Implement Temporal.ZonedDateTime.prototype.startOfDay 2024-11-26 11:00:56 +01:00
Timothy Flynn
3d0f384e01 LibJS: Implement Temporal.ZonedDateTime.prototype.with*
Includes:

Temporal.ZonedDateTime.prototype.with
Temporal.ZonedDateTime.prototype.withPlainTime
Temporal.ZonedDateTime.prototype.withCalendar
Temporal.ZonedDateTime.prototype.withTimeZone
2024-11-26 11:00:56 +01:00
Timothy Flynn
f2ab9e1aa9 LibJS: Implement Temporal.ZonedDateTime.prototype.round 2024-11-26 11:00:56 +01:00
Timothy Flynn
eadd0c40c9 LibJS: Implement Temporal.ZonedDateTime.prototype.since/until 2024-11-26 11:00:56 +01:00
Timothy Flynn
336efa5e3f LibJS: Implement Temporal.ZonedDateTime.prototype.add/subtract/equals 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
c0150acc5e LibJS: Implement Temporal.*.prototype.toZonedDateTimeISO and friends 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
3e6133cc09 LibJS: Handle ZonedDateTime in the various Temporal factories 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
f2c19f96f8 LibJS: Implement Temporal.Now 2024-11-25 13:32:58 +01:00
Timothy Flynn
f1c3e3d71a LibJS: Implement Temporal.Instant.prototype.round 2024-11-25 13:32:58 +01:00
Timothy Flynn
477f00aced LibJS: Implement Temporal.Instant.prototype.until/since 2024-11-25 13:32:58 +01:00
Timothy Flynn
1d67f28e72 LibJS: Implement Temporal.Instant.prototype.add/subtract/equals 2024-11-25 13:32:58 +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
82b540e501 LibJS: Implement Temporal.PlainDate.prototype.toPlainDateTime 2024-11-24 11:43:59 +01:00
Timothy Flynn
d22ea4db4c LibJS: Implement Temporal.PlainDateTime.prototype.valueOf 2024-11-24 11:43:59 +01:00
Timothy Flynn
649328fed2 LibJS: Implement Temporal.PlainDateTime.prototype.toPlainDate/Time 2024-11-24 11:43:59 +01:00
Timothy Flynn
990daaf63a LibJS: Implement Temporal.PlainDateTime.prototype.with* methods
Includes with, withCalendar, and withPlainTime.
2024-11-24 11:43:59 +01:00
Timothy Flynn
e3082b5bed LibJS: Implement Temporal.PlainDateTime.prototype.round 2024-11-24 11:43:59 +01:00
Timothy Flynn
906d951104 LibJS: Implement Temporal.PlainDateTime.prototype.since/until 2024-11-24 11:43:59 +01:00