Commit graph

20 commits

Author SHA1 Message Date
Linus Groh
fafc9b07c4 LibJS: Mark AO calls creating a copy of built-in objects as infallible
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/536f067
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
c3f1d8f5ba LibJS: Correct section IDs of Temporal .prototype property clauses
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/e4eb181
2022-05-25 00:25: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
e109b967a1 LibJS: Make options object const in more Temporal AOs 2022-04-08 00:43:17 +01:00
Linus Groh
29aa938fa5 LibJS: Fix Duration.compare() for dates with unusual number of hours
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/08bcd53
- https://github.com/tc39/proposal-temporal/commit/e962797
2022-03-31 17:09:10 +01: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
4722045e28 LibJS: Do not expose mathematical values to script in Duration methods
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/26a4c4f

No behavioral change as we already did this correctly, but I changed
some implicit JS::Value creations to explicit ones.
2022-03-10 23:20:39 +01:00
Linus Groh
ec1e1f4f12 LibJS: Disallow Temporal.Duration input values to be non-integers
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8c85450
2021-11-17 22:20:59 +00:00
Luke Wilde
5e3fe52fc4 LibJS: Implement Temporal.Duration.compare 2021-11-11 21:06:54 +00:00
Linus Groh
5e9e3f9dc8 LibJS: Convert Temporal.Duration functions to ThrowCompletionOr 2021-10-21 22:31:09 +01:00
Linus Groh
5832de62fe LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
2021-10-21 09:02:23 +01:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Linus Groh
ea7cc70118 LibJS: Convert Duration AOs to ThrowCompletionOr 2021-09-17 08:25:12 +01:00
Linus Groh
683e31e1ff LibJS: Convert to_integer_throw_on_infinity() to ThrowCompletionOr 2021-09-16 22:34:24 +01:00
Linus Groh
59df50a950 LibJS: Throw RangeError for +/-∞ argument values in Temporal.Duration()
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/ababe1b
2021-09-01 15:11:35 +01:00
Brian Gianforcaro
b10657a2b6 LibJS: Remove unused includes out of Cell.h, move to the users
Almost everything in LibJS includes Cell.h, don't force all code to
include AK/TypeCasts.h + AK/String.h. Instead include them where they
are actually used and required.
2021-08-01 08:10:16 +02:00
Linus Groh
5c77885873 LibJS: Implement Temporal.Duration.from()
...with ParseTemporalDurationString currently TODO()'d.
2021-07-19 00:34:28 +01:00
Linus Groh
7921d8ba91 LibJS: Start implementing Temporal.Duration
This patch adds the Duration object itself, its constructor and
prototype (currently empty), and three required abstract operations.
2021-07-16 01:07:01 +01:00