Andreas Kling
3bfb0534be
LibGC: Rename MarkedVector => RootVector
...
Let's try to make it a bit more clear that this is a Vector of GC roots.
2024-12-26 19:10:44 +01: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
0bc55424c8
LibJS: Fix variable reference in CreateDateTimeFormat
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/8acd353
2024-12-11 08:43:54 -08:00
Timothy Flynn
002b0ea7c7
LibJS: Remove dead code from ZonedDateTime.prototype.toLocaleString
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/065cf94
2024-12-11 08:43:54 -08:00
Timothy Flynn
b9ac4557d6
LibJS: Change variable name of parsed time zone offset
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/30d17d3
2024-12-11 08:43:54 -08:00
Pavel Shliak
6f81b80114
Everywhere: Include HashMap only where it's actually used
2024-12-09 12:31:16 +01:00
Timothy Flynn
234f218803
LibJS: Ensure GetDateTimeFormat returns nonnull for the best format
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/8a52801
2024-12-06 11:13:10 -05:00
Timothy Flynn
7104d724ee
LibJS: Simplify condition in GetDateTimeFormat
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/23c74b6
2024-12-06 11:13:10 -05:00
Timothy Flynn
6b8acc0af5
LibJS: Ensure DifferenceISODateTime receives valid ISO date-times
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/b5da334
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
784e872851
LibJS: Remove errant assertion from ParseISODateTime
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/728beeb
2024-12-05 15:29:08 -05:00
Timothy Flynn
0e81092685
LibJS: Make CombineDateAndTimeDuration infallible
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/794960c
2024-12-05 15:29:08 -05:00
Timothy Flynn
e29c6d2a80
LibJS: Mark invocation to CombineDateAndTimeDuration as infallible
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/6860ad1
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:
https://github.com/tc39/proposal-temporal/commit/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:
https://github.com/tc39/proposal-temporal/commit/7aef51e
https://github.com/tc39/proposal-temporal/commit/35cc12d
https://github.com/tc39/proposal-temporal/commit/2637ba5
https://github.com/tc39/proposal-temporal/commit/76dc52f
https://github.com/tc39/proposal-temporal/commit/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:
https://github.com/tc39/proposal-temporal/commit/05017b9
2024-12-05 15:29:08 -05:00
Timothy Flynn
4f07cddb2d
LibJS: Mark TemporalDurationFromInternal as infallible in difference AOs
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/76c6612
2024-12-05 15:29:08 -05:00
Timothy Flynn
81b38c66a8
LibJS: Avoid negated test in DifferenceTemporalZonedDateTime
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/38233ae
2024-12-05 15:29:08 -05:00
Timothy Flynn
5c0c1e507c
LibJS: Reverse date comparison in DifferenceISODateTime
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/4a8cdb5
2024-12-05 15:29:08 -05:00
Timothy Flynn
16aebef4f4
LibJS: Make DifferenceISODateTime infallible
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/df74f7f
2024-12-05 15:29:08 -05:00
Timothy Flynn
25c361bb96
LibJS: Remove errant period from ZonedDateTime.prototype.toPlainDate
...
This is an editorial change in the Temporal proposal. See:
https://github.com/tc39/proposal-temporal/commit/5e25315
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:
https://github.com/tc39/proposal-temporal/commit/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
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:
https://github.com/tc39/ecma402/commit/62fe5db
2024-12-05 09:49:55 +01:00
Timothy Flynn
e5ec8441c9
LibJS: Remove the Intl.PluralRules GetOperands AO
...
This is an editorial change in the ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/c7bca3a
2024-12-05 09:49:55 +01:00
Jonne Ransijn
d5fbf7323a
AK+LibJS: Allow {TRY,MUST}{,_OR_THROW_OOM} on list-initializers
...
List initializers may contain commas without surrounding parenthesis,
causing them to be passed as multiple macro arguments.
2024-12-04 16:45:58 +00: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
5cfd50224c
LibJS: Use enums instead of strings in Intl.DurationFormat AOs
2024-12-04 08:01:35 -05:00
Timothy Flynn
37fc9b6511
LibJS: Apply editorial updates to Intl.DurationFormat
...
To help prepare for its stage 4 promotion, this applies the editorial
updates made to Intl.DurationFormat over the last few months.
2024-12-04 08:01:35 -05:00
Jonne Ransijn
d7596a0a61
AK: Don't implicitly convert Optional<T&> to Optional<T>
...
C++ will jovially select the implicit conversion operator, even if it's
complete bogus, such as for unknown-size types or non-destructible
types. Therefore, all such conversions (which incur a copy) must
(unfortunately) be explicit so that non-copyable types continue to work.
NOTE: We make an exception for trivially copyable types, since they
are, well, trivially copyable.
Co-authored-by: kleines Filmröllchen <filmroellchen@serenityos.org >
2024-12-04 01:58:22 +01:00
Jonne Ransijn
edb3b10d11
LibJS: Align AsyncBlockStart with the latest drafts
...
`AsyncBlockStart` was still doing a `DisposeResources` call as
specified in older drafts of the `explicit-resource-management`
proposal, but the latest draft no longer does this, and it is
causing crashes when combined with the `array-from-async` proposal.
2024-12-02 18:20:56 -05:00
Shannon Booth
1a15e2cec6
LibJS: Allow comparing module records by equality
2024-12-01 11:56:18 +01:00
Jonne Ransijn
58631e9eef
LibJS: Add missing CommonPropertyNamess and StringMayBeNumber::Nos
2024-12-01 10:42:49 +01:00
Jonne Ransijn
cfb00ba494
LibJS: Stop lazily coercing numeric PropertyKeys
...
Lazily coercing might have made sense in the past, but since hashing
and comparing requires the `PropertyKey` to be coerced, and since a
`PropertyKey` will be used to index into a hashmap 99% of the time,
which will hash the `PropertyKey` and use it in comparisons, the
extra complexity and branching produced by lazily coercing has
become more trouble than it is worth.
Remove the lazy coercions, which then also neatly allows us to
switch to a `Variant`-based implementation.
2024-12-01 10:42:49 +01:00
Timothy Flynn
53a507303c
LibJS: Prevent extensions of TypedArray exotic objects
...
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/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
0d635100c4
LibJS: Port Date.parse string arguments to String
2024-11-26 15:02:07 -05: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
8e8c133db5
LibJS: Use Temporal for the Date constructor and Date.now()
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
a93d32a306
LibJS: Alphabetically sort property keys and error types
...
And make ErrorType definitions use a better hanging-indent style, to
make it easier to maintain going forward.
i.e. instead of:
M(VeryLongErrorNameHere, "very long error "
"message across multiple "
"lines"
We now have:
M(VeryLongErrorNameHere,
"very long error message across multiple "
"lines")
2024-11-26 11:35:15 -05:00
Timothy Flynn
6a9aec29d5
LibJS: Remove unused property names and error types
...
Held off on this during the Temporal rewrite in favor of just removing
these all in one go.
2024-11-26 11:35:15 -05:00