Linus Groh
5397278bfc
LibJS: Update spec comments to use ToZeroPaddedDecimalString AO
...
This is an editorial change in the ECMA-262 and Temporal specs.
See:
- 843d8b8
- f9211d9
Note that we don't actually need to implement the AO as we already have
String::formatted() for this, and use unified format strings instead of
zero-padding in individual steps in many cases anyway.
2022-04-12 23:43:29 +01:00
Luke Wilde
c32dcf7f75
LibJS: Update ZonedDateTime AO spec comments for structured headers
...
This is an editorial change in the Temporal spec.
See: 01714a5
2022-04-11 23:47:02 +01:00
Linus Groh
231acda7f8
LibJS: Fix two bogus spec links
2022-04-11 19:44:33 +01:00
Linus Groh
e109b967a1
LibJS: Make options object const in more Temporal AOs
2022-04-08 00:43:17 +01:00
Linus Groh
2844a2c448
LibJS: Handle undefined options in MergeLargestUnitOption
...
This is an editorial change in the Temporal spec.
See: 5e161a2
2022-04-08 00:43:17 +01:00
Linus Groh
151eb8606d
LibJS: Consistently call observable Temporal AOs with undefined options
...
This is a normative change in the Temporal spec.
See: 6fa5b9d
2022-04-07 12:58:39 +01:00
Linus Groh
0057d489bd
LibJS: Fix some clang-tidy warnings in Temporal
...
- Remove unused declarations of removed functions
- Remove unused includes
- Declare pointer values as `auto*`
2022-04-04 19:22:58 +01:00
Linus Groh
f0523aa098
LibJS: Use MUST() instead of TRY() for two infallible Temporal AOs
...
These were incorrectly used during the conversion from exception checks
to completions.
2022-04-04 19:04:07 +01:00
Linus Groh
83e8dfae38
LibJS: Use AK::Time in system_utc_epoch_nanoseconds()
...
This also uses <time.h> APIs internally, but wraps them in a much nicer
interface.
2022-04-03 01:10:31 +01:00
Idan Horowitz
086969277e
Everywhere: Run clang-format
2022-04-01 21:24:45 +01:00
Linus Groh
8e175b4959
LibJS: Adjust ISO8601 representation for years between 1 BCE and 999 CE
...
This is a normative change in the Temporal spec.
See: 39eeecd
2022-03-31 17:09:10 +01:00
Linus Groh
cfb04765fa
LibJS: Correct PlainYearMonth arithmetic for non-ISO calendars
...
This is a normative change in the Temporal spec.
See: 61e8dd0
2022-03-31 17:09:10 +01:00
Linus Groh
b020b8eea2
LibJS: Handle Etc/GMT timezones properly in TimeZone{IANA,Bracketed}Name
...
This is a normative change in the Temporal spec.
See: 8c73780
2022-03-31 17:09:10 +01:00
Linus Groh
b5392f9e39
LibJS: Emit reference information for { calendarName: "always" } option
...
This is a normative change in the Temporal spec.
See: 4f7519a
2022-03-31 17:09:10 +01:00
Linus Groh
29aa938fa5
LibJS: Fix Duration.compare() for dates with unusual number of hours
...
This is a normative change in the Temporal spec.
See:
- 08bcd53
- e962797
2022-03-31 17:09:10 +01:00
Linus Groh
f1d744e11a
LibJS: Fix sign in PlainYearMonth.prototype.subtract()
...
This is a normative change in the Temporal spec.
See: 6cf421b
2022-03-29 23:21:17 +01:00
Linus Groh
e4fe60b972
LibJS: Update incorrect spec comment in ToRelativeTemporalObject
...
This is a normative change in the Temporal spec.
See: 4cb192d
2022-03-29 22:56:03 +01:00
Linus Groh
a5ea066693
LibJS: Fix number types in GetISOPartsFromEpoch
...
This is an editorial change in the Temporal spec.
See: c5b645d
This means we now have to pass a global object and construct a BigInt
object just for the assertion, but oh well. We might want to have an
assertion macro that's optimized away in release builds at a later
point, however.
2022-03-25 18:33:55 +00:00
Linus Groh
9950f06623
LibJS: Update spec comment in BuiltinTimeZoneGetPlainDateTimeFor
...
This is an editorial change in the Temporal spec from a long time ago.
See: e480d40
2022-03-25 18:30:33 +00:00
Linus Groh
ff3256792d
LibJS: Change nanoseconds_to_days() argument from a JS to Crypto BigInt
...
This is an editorial change in the Temporal spec.
See: 0b1346c
2022-03-19 19:28:49 +00:00
Linus Groh
039cb9f189
LibJS: Change nanoseconds_to_days() result from a JS to Crypto BigInt
...
Similar to the preceding commit(s).
2022-03-19 19:28:49 +00:00
Linus Groh
360c65e92b
LibJS: Change balance_duration() nanoseconds from a JS to Crypto BigInt
...
Similar to the preceding commit.
2022-03-19 19:28:49 +00:00
Linus Groh
48856498f0
LibJS: Change total_duration_nanoseconds() from JS to Crypto BigInts
...
This removes a bunch of silly wrapping and unwrapping of Crypto
SignedBigInteger values in JS BigInt objects, which isn't even intended
by the spec - it just wants us to take an integer value, not a BigInt
specifically. Nice opportunity to remove a couple of allocations. :^)
2022-03-19 19:28:49 +00:00
Linus Groh
619794dfa7
LibJS: Fix fraction substring in ParseTimeZoneOffsetString
...
This is a normative change in the Temporal spec.
See:
- 97d553c
- d53af7f
Note that we already implemented this correctly, so the only change is
updating the spec comment.
2022-03-16 21:49:38 +00:00
Linus Groh
356fa2dca1
LibJS: Remove unused code in DifferenceISODate
...
This is an editorial change in the Temporal spec.
See: 056f695
2022-03-16 21:49:38 +00:00
Linus Groh
2ad69d789b
LibJS: Remove the ConstrainToRange AO
...
This is an editorial change in the Temporal spec.
See: 537b3e6
2022-03-16 21:49:38 +00:00
Linus Groh
1521c5f55c
LibJS: Remove argument type assertion from ParseTemporalDurationString
...
This is an editorial change in the Temporal spec.
See: 8615b41
2022-03-16 21:49:38 +00:00
Linus Groh
0c22a7f822
LibJS: Assume Get() on the result of PrepareTemporalFields can't fail
...
This is an editorial change in the Temporal spec.
See: 980e168
2022-03-16 21:49:38 +00:00
Linus Groh
251f5e8885
LibJS: Use CreateTemporalCalendar in GetBuiltinCalendar
...
This is an editorial change in the Temporal spec.
See: f6b3a10
2022-03-10 23:20:39 +01:00
Linus Groh
7f5b4842f2
LibJS: Replace dead code in ParseTimeZoneOffsetString with an assertion
...
This is an editorial change in the Temporal spec.
See: a29c40b
2022-03-10 23:20:39 +01:00
Linus Groh
55f9733316
LibJS: Add missing check in ParseTemporalInstant
...
This is an editorial change in the Temporal spec.
See: baead4d
2022-03-10 23:20:39 +01:00
Linus Groh
f75052ff7c
LibJS: Assert CreateTemporalDuration does not throw given correct input
...
This is an editorial change in the Temporal spec.
See: 881dd22
2022-03-10 23:20:39 +01:00
Linus Groh
d2c2a9bcbf
LibJS: Assert CreateTemporalDuration does not throw in Record cases
...
This is an editorial change in the Temporal spec.
See: 43e954c
2022-03-10 23:20:39 +01:00
Linus Groh
4553512321
LibJS: Assert CreateTemporalDuration does not throw in trivial cases
...
This is an editorial change in the Temporal spec.
See: 685e20e
2022-03-10 23:20:39 +01:00
Linus Groh
54af3a5396
LibJS: Adjust grammar for DateExtendedYear to exclude -000000
...
This is an editorial change in the Temporal spec.
See: fb3e656
We lose the custom error message, but it's not the end of the world.
2022-03-10 23:20:39 +01:00
Linus Groh
68af8649fb
LibJS: Follow rules for consuming completion records
...
This is an editorial change in the Temporal spec.
See: 1c19b96
2022-03-10 23:20:39 +01:00
Linus Groh
2bae040bc9
LibJS: Remove Sign abstract operation
...
This is an editorial change in the Temporal spec.
See: bbc1ebc
2022-03-10 23:20:39 +01:00
Linus Groh
0d06f3655f
LibJS: Move string-parsing code into ToTemporalDurationRecord
...
This is an editorial change in the Temporal spec.
See: a68b97b
2022-03-10 23:20:39 +01:00
Linus Groh
87fb005a8d
LibJS: Move IsValidDuration check into ToTemporalDurationRecord
...
This is an editorial change in the Temporal spec.
See: 00958d0
2022-03-10 23:20:39 +01:00
Linus Groh
34371b9b61
LibJS: Fix numeric type confusion in ToTemporalRoundingIncrement
...
This is an editorial change in the Temporal spec.
See: 6e59366
2022-03-10 23:20:39 +01:00
Linus Groh
4ceff91893
LibJS: Use different variable name in DifferenceISODateTime
...
This is an editorial change in the Temporal spec.
See: c32cc4d
2022-03-10 23:20:39 +01:00
Linus Groh
a009e834dc
LibJS: Add clarifying assertion to BalanceDurationRelative
...
This is an editorial change in the Temporal spec.
See: 9a3477a
2022-03-10 23:20:39 +01:00
Linus Groh
17da627b4c
LibJS: Fix "set it to" language to be more explicit
...
This is an editorial change in the Temporal spec.
See: de58241
2022-03-10 23:20:39 +01:00
Linus Groh
4722045e28
LibJS: Do not expose mathematical values to script in Duration methods
...
This is an editorial change in the Temporal spec.
See: 26a4c4f
No behavioral change as we already did this correctly, but I changed
some implicit JS::Value creations to explicit ones.
2022-03-10 23:20:39 +01:00
Linus Groh
a496868ee5
LibJS: Create Duration Records with their own abstract operations
...
This is an editorial change in the Temporal spec.
See:
- 387c405
- b203e26
- 387c405
2022-03-10 23:20:39 +01:00
Linus Groh
64e43c89bc
LibJS: Remove assertions that are now part of structured headers
...
This is an editorial change in the Temporal spec.
See:
- 7fbdd28
- f666243
- 8c7d066
- 307d108
- d9ca402
In practical terms this means we can now get rid of a couple of awkward
assertion steps that were no-ops anyway, since the types are enforced
by the compiler.
2022-03-10 23:20:39 +01:00
Linus Groh
97bd4cebab
LibJS: Refactor return value of RoundDuration
...
This is an editorial change in the Temporal spec.
See:
- 3641adf
- 8ea590c
2022-03-10 23:20:39 +01:00
Linus Groh
bdb13a74b0
LibJS: Describe various kinds of "Duration Records"
...
This is an editorial change in the Temporal spec.
See: 983902e
We already had these defined as structs, but now they're properly
defined in the spec (opposed to the previous anonymous records), and we
don't have to make up our own names anymore :^)
Note that while we're usually not including 'record' in the name, in
this case the 'Duration Record' has a name clash with the Duration
object. Additionally, later editorial changes introduce CreateFooRecord
AOs, so let's just go with FooRecord structs here.
2022-03-10 23:20:39 +01:00
Linus Groh
fb6c8781a2
LibJS: Update RoundDuration after DRY refactor in spec
...
This is an editorial change in the Temporal spec.
See: 4ef2748
Apparently I missed this in December! :^)
2022-03-10 00:42:49 +01:00
Linus Groh
bc183dbbcb
LibJS: Replace uses of MarkedValueList with MarkedVector<Value>
...
This is effectively a drop-in replacement.
2022-02-09 12:25:27 +00:00