davidot
791855deab
LibCrypto+LibJS: Remove the create_from methods from BigInteger
...
Instead we just use a specific constructor. With this set of
constructors using curly braces for constructing is highly recommended.
As then it will not do too many implicit conversions which could lead to
unexpected loss of data or calling the much slower double constructor.
Also to ensure we don't feed (Un)SignedBigInteger infinities we throw
RangeError earlier for Durations.
2022-08-26 19:18:26 +01:00
Linus Groh
2cf5f5c278
LibJS: Remove unused nonterminals from the ISO8601 parser
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/fe9ef00
2022-08-25 23:41:09 +01:00
Linus Groh
ccdfa2320c
LibJS: Replace GlobalObject with VM in Iterator AOs [Part 7/19]
2022-08-23 13:58:30 +01: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
b99cc7d050
LibJS+LibWeb: Replace GlobalObject with Realm in create() functions
...
This is a continuation of the previous two commits.
As allocating a JS cell already primarily involves a realm instead of a
global object, and we'll need to pass one to the allocate() function
itself eventually (it's bridged via the global object right now), the
create() functions need to receive a realm as well.
The plan is for this to be the highest-level function that actually
receives a realm and passes it around, AOs on an even higher level will
use the "current realm" concept via VM::current_realm() as that's what
the spec assumes; passing around realms (or global objects, for that
matter) on higher AO levels is pointless and unlike for allocating
individual objects, which may happen outside of regular JS execution, we
don't need control over the specific realm that is being used there.
2022-08-23 13:58:30 +01:00
Linus Groh
0355c72d6a
LibJS: Validate fractionalSecondDigits after truncation
...
This is a normative change in the Temporal spec.
Also correct some bogus spec numbers.
See:
- https://github.com/tc39/proposal-temporal/commit/39e1784
- https://github.com/tc39/proposal-temporal/commit/c3c0ee1
- https://github.com/tc39/proposal-temporal/commit/273cb2e
2022-07-30 10:50:50 +01:00
Linus Groh
ca85e157e8
LibJS: Use null-prototype objects in a few more places in Temporal
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/334479f
2022-06-29 07:35:42 +01:00
Linus Groh
3720f4bd8f
LibJS: Fix production for time zone name in time zone strings
...
This is a normative change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/caf013a
- https://github.com/tc39/proposal-temporal/commit/fb7cfa6
2022-06-29 07:35:42 +01:00
Linus Groh
ee0d5d6649
LibJS: Refactor common option reading into the GetDifferenceSettings AO
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/78abbb8
2022-06-24 22:12:03 +01:00
Linus Groh
80663d9d3b
LibJS: Mark CreateTemporalDate in ToRelativeTemporalObject as fallible
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/09e9f9c
2022-06-24 22:12:03 +01:00
Linus Groh
416f94eb3b
LibJS: Add Number conversion in PrepareTemporalFields
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/687d06c
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/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:
- https://github.com/tc39/proposal-temporal/commit/9586746
- https://github.com/tc39/proposal-temporal/commit/3c76ecc
- https://github.com/tc39/proposal-temporal/commit/96eab07
2022-06-15 17:49:20 +01:00
Linus Groh
30328d74d0
LibJS: Use MaximumTemporalDurationRoundingIncrement in two more places
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/de582e2
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/d8b3423
2022-06-15 17:49:20 +01:00
Linus Groh
d1b71cba25
LibJS: Explicitly handle "auto" vs. number fractionalSecondDigits
...
This is an editorial change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/4dd6713
- https://github.com/tc39/proposal-temporal/commit/4c2476b
- https://github.com/tc39/proposal-temporal/commit/f1a839b
- https://github.com/tc39/proposal-temporal/commit/c775ebe
- https://github.com/tc39/proposal-temporal/commit/0409774
(Changes across multiple commits, that ended up being reverted.)
2022-06-15 17:49:20 +01:00
Linus Groh
cbc4cf057d
LibJS: Improve an alias name in ToSecondsStringPrecision
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/b75bd9e
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/1b3d018
2022-06-10 12:39:11 +02:00
Linus Groh
3bb94dd62e
LibJS: Refactor Temporal parse AOs
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/7fe29eb
2022-06-10 12:39:11 +02:00
Linus Groh
9400b76d79
LibJS: Remove assertions replaced with structured headers
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/74fd5e8
2022-05-25 00:25:23 +01: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
Linus Groh
6d7970a23c
LibJS: Remove unnecessary CalendarDate production
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/48744ea
2022-05-16 20:33:22 +01:00
Linus Groh
03017be5bd
LibJS: Remove redundant TemporalRelativeToString production
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/f85f953
2022-05-16 20:29:32 +01:00
Linus Groh
51e01b5a80
LibJS: Remove redundant TemporalDateString production
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/41a8a5c
2022-05-16 20:28:26 +01:00
Linus Groh
33f53041e7
LibJS: Replace "enclosed by" with "contained within" in spec comments
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/cb10d3f
2022-05-16 20:17:23 +01: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
70593b7448
LibJS: Update for structured headers added to various Temporal AOs
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/e6a15a5
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
7bf4a785c6
LibJS: Fix RoundNumberToIncrement spec number
2022-04-29 21:52:30 +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
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: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/6fa5b9d
2022-04-07 12:58:39 +01:00
Linus Groh
e4fe60b972
LibJS: Update incorrect spec comment in ToRelativeTemporalObject
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/4cb192d
2022-03-29 22:56:03 +01:00
Linus Groh
2ad69d789b
LibJS: Remove the ConstrainToRange AO
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/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: https://github.com/tc39/proposal-temporal/commit/8615b41
2022-03-16 21:49:38 +00:00
Linus Groh
54af3a5396
LibJS: Adjust grammar for DateExtendedYear to exclude -000000
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/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: 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
34371b9b61
LibJS: Fix numeric type confusion in ToTemporalRoundingIncrement
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/6e59366
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
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
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
c48f695b90
LibJS: Remove '-000000' check from ParseTemporalYearMonthString
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/3be4b5d
2022-02-04 20:00:34 +00:00