Commit graph

18 commits

Author SHA1 Message Date
Idan Horowitz
830d484d78 LibJS: Change GetISOPartsFromEpoch's return type to ISODateTime
This AO can't throw so its optional is never empty.
2021-09-16 13:53:37 +01:00
Idan Horowitz
5a4c90fcb1 LibJS: Convert ordinary_create_from_constructor<T> to ThrowCompletionOr 2021-09-16 13:53:37 +01:00
Linus Groh
e4c07c5b8f LibJS: Make new_target parameter of all Temporal AOs a const*
These are passed to ordinary_create_from_constructor() in each case,
which takes the parameter as a const&, so these can also be const.
2021-09-09 23:46:45 +01:00
Linus Groh
86a7c795f6 LibJS: Use the newly added remainder operation in GetISOPartsFromEpoch
This is a normative change in the Temporal spec. No behavioral change,
just a clarification.

See: https://github.com/tc39/proposal-temporal/commit/b7bdc65
2021-09-08 00:07:18 +01:00
Linus Groh
576be0f8e7 LibJS: Implement Temporal.Instant.prototype.toString() 2021-08-31 16:35:51 +02:00
Linus Groh
0cdad283c0 LibJS: Reflect Record wording editorial change in the Temporal spec
See: https://github.com/tc39/proposal-temporal/commit/c8f14d0
2021-08-17 21:59:35 +01:00
Linus Groh
16c38788c3 LibJS: Add missing spec links 2021-08-08 11:04:30 +01:00
Linus Groh
6c345c8107 LibJS: Implement Temporal.ZonedDateTime.prototype.offset 2021-08-05 19:19:40 +02:00
Linus Groh
1f5098f61e LibJS: Handle ZonedDateTime in ToTemporalTimeZone 2021-08-01 20:31:31 +01:00
Linus Groh
e511390423 LibJS: Implement Temporal.TimeZone.prototype.getPlainDateTimeFor() 2021-08-01 10:24:38 +01:00
Linus Groh
c4123d8aad LibJS: Implement Temporal.TimeZone.prototype.getOffsetStringFor() 2021-08-01 10:24:38 +01:00
Linus Groh
4d0f849654 LibJS: Replace TypeError with RangeError in GetOffsetNanosecondsFor
Also fix "a integral number" => "an integral number".
2021-07-30 19:53:25 +01:00
Linus Groh
c303bbde54 LibJS: Implement Temporal.Now.plainDate()
...and ten required AOs we didn't have yet:

- BalanceISODate
- BalanceISODateTime
- BalanceISOYearMonth
- BalanceTime
- BuiltinTimeZoneGetPlainDateTimeFor
- GetISOPartsFromEpoch
- GetOffsetNanosecondsFor
- ParseTemporalTimeZone
- SystemDateTime
- ToTemporalTimeZone
2021-07-27 19:51:44 +01:00
Linus Groh
96e63415b6 LibJS: Implement Temporal.TimeZone.prototype.getOffsetNanosecondsFor() 2021-07-25 23:44:36 +01:00
Linus Groh
6c8f0fbb35 LibJS: Use more specific return types for some Temporal AOs
Instead of returning Object* we should be specific and return Instant*,
TimeZone* etc.
2021-07-14 23:50:03 +01:00
Daniel Bertalan
cd55b817cf LibJS: Use AK::abs in TimeZone
This fixes a `-Wabsolute-value` warning emitted because of our use of
`abs()` on arguments of type `long long`.
2021-07-14 13:12:25 +02:00
Idan Horowitz
b816037739 LibJS: Add the ToTemporalInstant Abstract Operation & its requirements
This is Abstract Operation is required for the majority of
InstantConstructor's and InstantPrototype's methods.

The implementation is not entirely complete, (specifically 2 of the
underlying required abstract operations, ParseTemporalTimeZoneString
and ParseISODateTime are missing the required lexing, and as such are
TODO()-ed) but the majority of it is done.
2021-07-12 19:05:17 +01:00
Linus Groh
265e89367e LibJS: Start implementing Temporal.TimeZone
Here we got our first Temporal object :^)
This patch adds the TimeZone object itself, its constructor and
prototype (currently empty), and a bunch of required abstract operations
2021-07-07 00:42:01 +01:00