Commit graph

79 commits

Author SHA1 Message Date
Luke Wilde
b2bbd4d2b8 LibJS: Implement Temporal.PlainDateTime.prototype.toString 2021-11-03 11:03:30 +01:00
Linus Groh
d49bbb1da3 LibJS: Implement TODO()'d parts of balance_duration()
Massive :yakstack:, so I understand why it was skipped in the first
place :^)
2021-11-02 09:24:35 +01:00
Linus Groh
97f6c6029f LibJS: Implement Temporal.TimeZone.prototype.getInstantFor() 2021-11-01 21:39:45 +01:00
Linus Groh
4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Linus Groh
f90d98aef0 LibJS: Update step order in the InterpretTemporalDateTimeFields AO
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/be88667
2021-09-18 13:38:48 +02:00
Linus Groh
d764f1c699 LibJS: Convert PlainDateTime AOs to ThrowCompletionOr 2021-09-17 23:43:01 +02:00
Linus Groh
20337a34a2 LibJS: Convert Instant AOs to ThrowCompletionOr 2021-09-17 08:25:12 +01:00
Linus Groh
f8d92232c8 LibJS: Convert Calendar AOs to ThrowCompletionOr 2021-09-17 08:25:12 +01:00
Linus Groh
6b4777c558 LibJS: Convert prepare_temporal_fields() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
3c530dec5a LibJS: Convert parse_temporal_date_time_string() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
9f03647f1f LibJS: Convert to_temporal_overflow() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Idan Horowitz
229a5ce149 LibJS: Convert PlainTime AOs to ThrowCompletionOr 2021-09-16 13:53:37 +01:00
Idan Horowitz
cc00a726a8 LibJS: Convert TimeZone AOs to ThrowCompletionOr 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
81aaa9ccd5 LibJS: Replace String const& with StringView in various Temporal AOs
This is especially helpful where we already pass StringView literals
and only compare them with others, e.g. overflow and largest/smallest
unit, in which case there's no need to actually allocate a string.
2021-09-08 23:42:26 +01:00
Linus Groh
8105d3f3d6 LibJS: Change offset in ISODateTimeWithinLimits to actually 24h
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/1d61d6f
2021-09-01 15:11:35 +01:00
Linus Groh
576be0f8e7 LibJS: Implement Temporal.Instant.prototype.toString() 2021-08-31 16:35:51 +02:00
Idan Horowitz
f6370fe3f7 LibJS: Add the ToTemporalTime AO and stub the ParseTemporalTimeString AO
This AO is required for a bunch of PlainTime related methods.

As part of this change the `TemporalTime` record was renamed to
`UnregulatedTemporalTime` and a new `TemporalTime` record that matches
the other Temporal parse result records was added. This also has the
added benefit of getting rid of a would be round-trip cast from integer
to double and back in `ParseTemporalTimeString`.
2021-08-27 19:01:30 +01:00
Idan Horowitz
28fa4d1568 LibJS: Add the CompareTemporalTime & CompareISODateTime AOs
These are required for implementing comparisons between `PlainTime`s and
`PlainDateTime`s.
2021-08-27 16:40:16 +01:00
Linus Groh
ad427f85ca LibJS: Implement Temporal.PlainDateTime.from() 2021-08-23 20:54:52 +01:00
Andreas Kling
286a7ecd92 LibJS: Call base class visit_edges() in various Temporal objects
When overriding visit_edges() in a JS::Object subclass, we must make
sure to call the base class visit_edges(), or the object's Shape (and
any properties) will not get marked.
2021-08-14 20:12:22 +02:00
Linus Groh
f58891ed42 LibJS: Add a js_bigint(VM&, ...) overload and use it
We already have js_string(VM&, ...) and js_symbol(VM&, ...) overloads,
so feels very familiar.
2021-08-03 00:14:48 +01:00
Linus Groh
321f2c0927 LibJS: Fix types of PlainDateTime iso_{milli,micro,nano}second params
999 does not fit into an u8. :^)
2021-07-28 21:57:30 +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
Idan Horowitz
2c6bd3a61b LibJS: Use narrower types in Temporal PlainDate/PlainDateTime/Calendar
These are bounds-checked during construction of PlainDate/PlainDateTime
and as such theres no need to widen them in these internal AO calls.
2021-07-26 16:15:31 +01:00
Linus Groh
4be3196882 LibJS: Start implementing Temporal.PlainDateTime
This commit adds the PlainDateTime object itself, its constructor and
prototype (currently empty), and the CreateTemporalDateTime abstract
operation.
2021-07-22 21:19:40 +01:00
Idan Horowitz
cc00ccec41 LibJS: Start implementing Temporal.PlainDate
This commit adds the PlainDate object itself, its constructor and
prototype (currently empty), and several required abstract operations.
2021-07-19 09:11:20 +01: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