Linus Groh
82ba940646
LibJS: Port format_seconds_string_part() to String
2023-01-26 20:20:54 +00:00
Linus Groh
654911444e
LibJS: Port merge_largest_unit_option() to String
2023-01-26 20:20:54 +00:00
Linus Groh
918122c1e3
LibJS: Port get_temporal_unit() to String
2023-01-26 20:20:54 +00:00
Linus Groh
f928c7754d
LibJS: Port to_show_offset_option() to String
2023-01-26 20:20:54 +00:00
Linus Groh
ddd5d8531b
LibJS: Port to_time_zone_name_option() to String
2023-01-26 20:20:54 +00:00
Linus Groh
0435156a86
LibJS: Port to_calendar_name_option() to String
2023-01-26 20:20:54 +00:00
Linus Groh
a387b22599
LibJS: Port to_temporal_offset() to String
2023-01-26 20:20:54 +00:00
Linus Groh
3aa3ab65b1
LibJS: Port to_temporal_rounding_mode() to String
...
Also make negate_temporal_rounding_mode() take a StringView as part of
this, it only does equality checks.
2023-01-26 20:20:54 +00:00
Linus Groh
ec9f2013c9
LibJS: Port to_temporal_disambiguation() to String
2023-01-26 20:20:54 +00:00
Linus Groh
b8759e86ee
LibJS: Port to_temporal_overflow() to String
2023-01-26 20:20:54 +00:00
BodilessSleeper
90b43712e6
LibJS: Rename ToIntegerThrowOnInfinity to ToIntegerWithTruncation
...
This commit ticks away two of the boxes in #15525
Temporal commits: tc39/proposal-temporal@f274678 and
tc39/proposal-temporal@a63a0fb
2023-01-06 11:16:55 +01:00
BodilessSleeper
1f1b2f4d26
LibJS: Rename ToPositiveInteger -> ToPositiveIntegerWithTruncation
...
This commit ticks away one of the boxes in #15525
Temporal commit: tc39/proposal-temporal@768b916
2023-01-03 17:53:51 +01:00
Linus Groh
6e19ab2bbc
AK+Everywhere: Rename String to DeprecatedString
...
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Jonah
381b36b83f
LibJS/Temporal: Rename ToIntegerWithRounding to ToIntegerIfIntegral
...
This is an editorial change to the Temporal spec.
See: 1dceb57
2022-11-20 11:56:56 +00:00
Smrtnyk
2ba2e6ca0a
LibJS: Rename ToShowTimeZoneNameOption to ToTimeZoneNameOption
...
This is an editorial change in Temporal spec.
See: ab5b1ba910
2022-11-05 15:44:49 +00:00
Smrtnyk
efe82e5c91
LibJS: Rename ToShowCalendarOption to ToCalendarNameOption
...
This is an editorial change in the Temporal spec.
See: 2c9e2615f7
2022-11-04 21:00:25 +00:00
Linus Groh
b6f101f1c0
LibJS: Fix TemporalCalendarString ambiguity
...
This is a normative change in the Temporal spec.
See:
- 278d238
- b73aea7
2022-10-16 15:20:23 +02:00
snooze6214
1fde3737f4
LibJS: Move time zone annotation parsing into ParseISODateTime
...
This is an editorial change in the Temporal spec.
See: tc39/proposal-temporal@c410e25e47
2022-10-15 05:09:09 +00:00
Linus Groh
a022e548b8
LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]
...
This is where the fun begins. :^)
2022-08-23 13:58:30 +01:00
Linus Groh
694f66b5ca
LibJS: Replace GlobalObject with VM in Temporal AOs [Part 2/19]
2022-08-23 13:58:30 +01:00
Linus Groh
f3117d46dc
LibJS: Remove GlobalObject from VM::throw_completion()
...
This is a continuation of the previous five commits.
A first big step into the direction of no longer having to pass a realm
(or currently, a global object) trough layers upon layers of AOs!
Unlike the create() APIs we can safely assume that this is only ever
called when a running execution context and therefore current realm
exists. If not, you can always manually allocate the Error and put it in
a Completion :^)
In the spec, throw exceptions implicitly use the current realm's
intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23 13:58:30 +01:00
Linus Groh
ee0d5d6649
LibJS: Refactor common option reading into the GetDifferenceSettings AO
...
This is an editorial change in the Temporal spec.
See: 78abbb8
2022-06-24 22:12:03 +01:00
Linus Groh
b2965cf204
LibJS: Fix Instant rounding modes
...
This is a normative change in the Temporal spec.
See: 0993b75
2022-06-15 17:49:20 +01:00
Linus Groh
52a4ee563d
LibJS: Assume options is an object in the MergeLargestUnitOption AO
...
This is an editorial change in the Temporal spec.
See: 20a04ac
2022-06-15 17:49:20 +01:00
Linus Groh
9b3602d000
LibJS: Update missing/superfluous commas in various spec comments
...
These are editorial changes in the Temporal spec.
See:
- 9586746
- 3c76ecc
- 96eab07
2022-06-15 17:49:20 +01:00
Linus Groh
71a519831d
LibJS: Update to the latest ECMA-402 GetOption and move it into ECMA-262
...
This is an editorial change in the Temporal spec.
See: 4e79b69
2022-06-15 17:49:20 +01:00
Linus Groh
46d2ac6da4
LibJS: Align Temporal GetOption AO with ECMA-402
...
This is an editorial change in the Temporal spec.
See: 7b6a264
2022-06-15 17:49:20 +01:00
Linus Groh
c8d84f33b0
LibJS: Remove unused GetStringOrNumberOption operation
...
This is an editorial change in the Temporal spec.
See: d8b3423
2022-06-15 17:49:20 +01:00
Linus Groh
3e6561c75f
LibJS: Fold PreparePartialTemporalFields into PrepareTemporalFields
...
This is an editorial change in the Temporal spec.
See: 6ed1835
2022-06-15 17:49:20 +01:00
Linus Groh
4c77575ec5
LibJS: Simplify Temporal unit AOs
...
This is an editorial change in the Temporal spec.
See: 1b3d018
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: 75279e5
Co-Authored-By: Idan Horowitz <idan.horowitz@gmail.com>
2022-05-25 00:25:23 +01:00
Linus Groh
cc8f5151d7
LibJS: Refactor Temporal since/until to common AOs
...
This is an editorial change in the Temporal spec.
See: 85a9f57
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:
- 2f96efc
- 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: bbcd37b
2022-04-29 22:40:46 +02: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
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
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
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
bc183dbbcb
LibJS: Replace uses of MarkedValueList with MarkedVector<Value>
...
This is effectively a drop-in replacement.
2022-02-09 12:25:27 +00:00
Linus Groh
6d744eb4a7
LibJS: Use consistent name for offset strings
...
This is an editorial change in the Temporal spec.
See: 17f8cdb
2022-01-23 00:22:10 +00:00
Linus Groh
7270bbb255
LibJS: Remove outdated comment from parse_temporal_duration_string()
...
This is a normative change in the Temporal spec.
See:
- e7182d3
- 6dae066
2021-12-18 22:32:39 +00:00
Timothy Flynn
1039159a6c
LibJS: Change LargerOfTwoTemporalUnits AO to return a StringView
2021-11-30 00:01:07 +00:00
Linus Groh
1e41a8668d
LibJS: Add sign(Crypto::SignedBigInteger const&) overload
2021-11-24 17:53:00 +00:00
Linus Groh
55dbd19a16
LibJS: Update to_largest_temporal_unit() to allow undefined fallback
...
This is required for Temporal.Duration.prototype.round(). Subsequently,
this now returns ThrowCompletionOr<Optional<String>>, which brings the
signature in line with that of to_smallest_temporal_unit().
Much nicer! :^)
2021-11-23 21:03:05 +00:00
Linus Groh
de23f0b68c
LibJS: Start fleshing out an ISO 8601 parser for Temporal
...
This is the start of a parser for the ISO 8601 grammar used in the
Temporal spec:
https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar
We will, on purpose, not use a generic ISO 8601 parser from AK or
similar for two reasons:
- Many AOs make specific assumptions about which productions exist and
access them directly, even when they're part of a larger production.
- The spec says "The grammar deviates from the standard given in ISO
8601 in the following ways:" and then lists 17 of such deviations.
Making that work with a general purpose parser is not worth it.
The public API is not being used anywhere yet, but will be in the next
couple of commits. Likewise, the Production enum will be populated with
all the productions accessed directly (e.g. TemporalDateString).
Many thanks to Ali for showing me how to improve my initial approach
full of macros with a nice RAII helper - it's much nicer :^)
Co-Authored-By: Ali Mohammad Pur <mpfard@serenityos.org>
2021-11-20 23:10:09 +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: 8c85450
2021-11-17 22:20:59 +00:00