Linus Groh
a25c5d8fe8
LibJS: Make relativeTo required for AdjustRoundedDurationDays
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/48e0a15
2022-06-18 13:54:46 +01:00
Linus Groh
3bc54ac75a
LibJS: Mark a call of CreateDurationRecord as fallible
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/462f027
2022-06-15 17:49:20 +01:00
Linus Groh
81b9a2e4a1
LibJS: Mark a call of CreateDateDurationRecord as fallible
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/5411f62
2022-06-15 17:49:20 +01:00
Linus Groh
8be4cc9653
LibJS: Make options mandatory in Difference{Zoned,ISO}DateTime
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/d4c4a16
2022-06-15 17:49:20 +01:00
Linus Groh
5eb48f6f3a
LibJS: Remove constant arguments from CalculateOffsetShift
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/0bc5f9d
2022-06-15 17:49:20 +01:00
Linus Groh
6cc69bbd8e
LibJS: Rename ToPartialDuration to ToTemporalPartialDurationRecord
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/0509d41
2022-06-15 17:49:20 +01:00
Linus Groh
6982e53113
LibJS: Leverage ToPartialDuration in ToTemporalDurationRecord
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/c3efde0
2022-06-15 17:49:20 +01:00
Linus Groh
b9beb2b120
LibJS: Remove unnecessary ToLimitedTemporalDuration AO
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/c6571f4
2022-06-10 12:39:11 +02:00
Linus Groh
ae1fdf299d
LibJS: Use the rounding abstract operations from Intl.NumberFormat V3
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/75279e5
Co-Authored-By: Idan Horowitz <idan.horowitz@gmail.com>
2022-05-25 00:25:23 +01:00
Luke Wilde
2b764b3594
LibJS: Remove faulty assertion in BalanceDurationRelative
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/66f7464
2022-05-16 20:48:41 +01:00
Linus Groh
80048c694a
LibJS: Use '2 × nsMaxInstant' in a couple of assertion comments
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a225863
2022-05-09 20:27:20 +02:00
Linus Groh
b751f80166
LibJS: Change internal slots of Duration to store mathematical values
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/1f3fba8
2022-05-08 01:01:32 +02:00
Linus Groh
6a2b73a4a9
LibJS: Simplify DaysUntil
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/b2254b4
2022-05-08 00:07:58 +02:00
Linus Groh
3729a910f6
LibJS: Refactor Temporal add/subtract to common AOs
...
This is an editorial change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/2f96efc
- https://github.com/tc39/proposal-temporal/commit/fbff635
2022-05-08 00:07:58 +02:00
Linus Groh
27793bf76c
LibJS: Replace U+2212 MINUS SIGN with U+002D HYPHEN-MINUS
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/bbcd37b
2022-04-29 22:40:46 +02:00
Linus Groh
9a3014c91a
LibJS: Drop "integral part of" language
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/6ec1608
2022-04-29 22:40:46 +02:00
Linus Groh
5397278bfc
LibJS: Update spec comments to use ToZeroPaddedDecimalString AO
...
This is an editorial change in the ECMA-262 and Temporal specs.
See:
- https://github.com/tc39/ecma262/commit/843d8b8
- https://github.com/tc39/proposal-temporal/commit/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
Linus Groh
151eb8606d
LibJS: Consistently call observable Temporal AOs with undefined options
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/6fa5b9d
2022-04-07 12:58:39 +01: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: https://github.com/tc39/proposal-temporal/commit/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
f75052ff7c
LibJS: Assert CreateTemporalDuration does not throw given correct input
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/881dd22
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: https://github.com/tc39/proposal-temporal/commit/685e20e
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/00958d0
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/de58241
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:
- https://github.com/tc39/proposal-temporal/commit/387c405
- https://github.com/tc39/proposal-temporal/commit/b203e26
- https://github.com/tc39/proposal-temporal/commit/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:
- https://github.com/tc39/proposal-temporal/commit/7fbdd28
- https://github.com/tc39/proposal-temporal/commit/f666243
- https://github.com/tc39/proposal-temporal/commit/8c7d066
- https://github.com/tc39/proposal-temporal/commit/307d108
- https://github.com/tc39/proposal-temporal/commit/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:
- https://github.com/tc39/proposal-temporal/commit/3641adf
- https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/4ef2748
Apparently I missed this in December! :^)
2022-03-10 00:42:49 +01:00
Linus Groh
5277646f46
LibJS: Fix 'precision != "auto"' check in temporal_duration_to_string()
...
If the Variant does *not* have a StringView, it *also* is not "auto".
Thanks to YouTube user JWeis for noticing this :^)
2021-12-18 23:20:00 +00:00
Linus Groh
acce65b52c
LibJS: Fix fractionalSecondDigits behavior in Duration.proto.toString()
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/3ee771e
2021-12-18 22:32:39 +00:00
Linus Groh
bdb8fc54f2
LibJS: Update spec comment in balance_duration_relative()
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/665871e
2021-12-09 23:18:01 +00:00
Andreas Kling
fed6a76990
LibJS: Add Handle::operator->()
2021-12-09 21:28:52 +01:00
Timothy Flynn
1039159a6c
LibJS: Change LargerOfTwoTemporalUnits AO to return a StringView
2021-11-30 00:01:07 +00:00
Linus Groh
7a2eeae8c6
LibJS: Implement Temporal.ZonedDateTime.prototype.until()
2021-11-24 17:53:00 +00:00
Luke Wilde
7dc846d51c
LibJS: Implement balance_duration_relative()
2021-11-24 17:53:00 +00:00
Luke Wilde
9559cea8e5
LibJS: Implement add_duration()
2021-11-24 17:53:00 +00:00
Luke Wilde
1f84deaf63
LibJS: Implement default_temporal_largest_unit()
2021-11-24 17:53:00 +00:00
Linus Groh
a20b189eab
LibJS: Fix incorrectly formatted section comments
...
A couple of missing URLs, spaces, and a stray comma.
2021-11-24 17:37:27 +00:00
Linus Groh
8d6d39e07c
LibJS: Treat relativeTo parameters as PlainDate or ZonedDateTime
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/c822e14
2021-11-19 19:59:13 +00:00
Linus Groh
ec1e1f4f12
LibJS: Disallow Temporal.Duration input values to be non-integers
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8c85450
2021-11-17 22:20:59 +00:00
Linus Groh
dbe70e7c55
LibJS: Implement Temporal.Duration.prototype.total()
2021-11-13 18:50:54 +00:00
Linus Groh
656efe5d6c
LibJS: Fix days calculation in round_duration() for "year" - "day" units
...
This relies on floating point division, which is not possible with
LibCrypto bigints at the moment. So, instead of completely ignoring the
remainder we now first do a bigint division, then convert the remainder
to a double, and do another native floating point division to get the
final result.
2021-11-13 18:50:54 +00:00
Linus Groh
f11277b50d
LibJS: Fix missing handling of "week" largest_unit in balance_duration()
...
It would crash because of VERIFY(largest_unit == "nanosecond"sv) in the
final else branch when passing "week", because it's not handled in any
of the previous branches.
2021-11-13 14:21:08 +00:00