Jonah
00da2e86e6
LibJS/Temporal: Unroll the loop in to_temporal_duration_record
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8e80575
2022-11-20 11:56:56 +00:00
Jonah
912867526b
LibJS/Temporal: Unroll the loop in to_temporal_partial_dictation_record
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/8e80575
2022-11-20 11:56:56 +00:00
Jonah
1cd0b5ad8a
LibJS/Temporal: Reorder Tables by Order of Magnitude
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/f2d5642 and
https://github.com/tc39/proposal-temporal/commit/07673d3
2022-11-20 11:56:56 +00:00
Linus Groh
24c0a6e9a4
Revert "LibJS: Add explicit assertion for days"
...
This reverts commit 56abb01ee3
.
Unfortunately, the assertion doesn't work out as expected and crashes
test-js.
2022-11-11 14:10:02 +00:00
Smrtnyk
56abb01ee3
LibJS: Add explicit assertion for days
...
This is an editorial change in Temporal spec.
See: 15b7293b38
2022-11-11 12:14:46 +00:00
Idan Horowitz
d795f9c6cf
LibJS: Change dateAdd to a required parameter of MoveRelativeDate
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/45d9079
2022-10-16 13:45:56 +02:00
Idan Horowitz
3c55643283
LibJS: Add dateAdd to all remaining MoveRelativeDate calls
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/a48838a
2022-10-16 13:45:56 +02:00
Idan Horowitz
4e79ce4e7a
LibJS: Add optional dateAdd parameter to MoveRelativeDate
...
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/891060f
2022-10-16 13:45:56 +02:00
Timothy Flynn
4fbec2e8b3
LibJS: Replace RoundTowardsZero with truncate
...
This is an editorial change in the Temporal spec. See:
https://github.com/tc39/proposal-temporal/commit/409ab66
2022-10-15 18:05:02 +02:00
davidot
1be337353b
LibJS: Make sure to exactly add nanoseconds in add_duration
...
If the given nanoseconds values add to something above 2**53 - 1 we are
potentially rounding the double to some near integer value.
2022-10-14 11:23:50 +02:00
Linus Groh
50428ea8d2
LibJS: Move intrinsics to the realm
...
Intrinsics, i.e. mostly constructor and prototype objects, but also
things like empty and new object shape now live on a new heap-allocated
JS::Intrinsics object, thus completing the long journey of taking all
the magic away from the global object.
This represents the Realm's [[Intrinsics]] slot in the spec and matches
its existing [[GlobalObject]] / [[GlobalEnv]] slots in terms of
architecture.
In the majority of cases it should now be possibly to fully allocate a
regular object without the global object existing, and in fact that's
what we do now - the realm is allocated before the global object, and
the intrinsics between both :^)
2022-08-27 11:29:10 +01:00
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
b345a0acca
LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
...
- Prefer VM::current_realm() over GlobalObject::associated_realm()
- Prefer VM::heap() over GlobalObject::heap()
- Prefer Cell::vm() over Cell::global_object()
- Prefer Wrapper::vm() over Wrapper::global_object()
- Inline Realm::global_object() calls used to access intrinsics as they
will later perform a direct lookup without going through the global
object
2022-08-23 13:58:30 +01:00
Linus Groh
25849f8a6d
LibJS: Replace GlobalObject with VM in common AOs [Part 18/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
8ed28890e4
LibJS: Correct BalanceDurationRelative algorithm
...
This is a normative change in the Temporal spec.
See:
- https://github.com/tc39/proposal-temporal/commit/cbf5863
- https://github.com/tc39/proposal-temporal/commit/f47d57d
2022-08-06 13:42:37 +01:00
Idan Horowitz
d35d106f01
LibJS: Remove invalid CreateDateDurationRecord AO overload
2022-07-20 21:07:49 +01:00
Timothy Flynn
a712c7b5e1
LibJS: Replace comparisons of "0"_bigint with SignedBigInteger::is_zero
...
This just avoids creating UnsignedBigInteger's underlying vector.
2022-07-18 08:51:07 +01:00
Linus Groh
071b92e920
LibJS: Fix typos in Temporal spec comments
...
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/b0411b4
2022-07-10 01:29:28 +02:00
Linus Groh
5b1e2cc65c
LibJS: Update AdjustRoundedDurationDays function signature comment
...
I missed this in a25c5d8
. Thanks to Idan for noticing :^)
2022-06-18 13:58:08 +01:00
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