Timothy Flynn
733192089f
LibJS: Implement Intl.NumberFormat V3's [[UseGrouping]] changes
...
In the main spec, [[UseGrouping]] can be true or false. In V3, it may be
one of:
auto: Respect the per-locale preference for grouping.
always: Ignore per-locale preference for grouping and always insert
the grouping separator (note: true is now an alias for always).
min2: Ignore per-locale preference for grouping and only insert the
grouping separator if the primary group has at least 2 digits.
false: Ignore per-locale preference for grouping and never insert
the grouping separator.
2022-07-13 19:22:26 +01:00
Timothy Flynn
cd4ee46b70
LibJS: Populate roundingPriority in Intl.PluralRules.resolvedOptions
...
This is inherited from Intl.NumberFormat.
2022-07-13 19:22:26 +01:00
Timothy Flynn
33698b9615
LibJS+js: Parse new constructor options from Intl.NumberFormat V3
...
This contains minimal changes to parse newly added and modified options
from the Intl.NumberFormat V3 proposal, while maintaining main spec
behavior in Intl.NumberFormat.prototype.format. The parsed options are
reflected only in Intl.NumberFormat.prototype.resolvedOptions and the js
REPL.
2022-07-13 19:22:26 +01:00
Obinna Ikeh
d6d1ae667d
LibJS: Add test case for %TypedArray%.prototype.toSpliced
2022-07-12 00:44:34 +01:00
Timothy Flynn
f089c11b5b
LibJS: Implement Intl.PluralRules.prototype.selectRange
2022-07-12 00:43:34 +01:00
Luke Wilde
da25ac0d48
AK: Treat empty string as invalid JSON
...
Previously we would treat the empty string as `null`. This caused
JavaScript like this to fail:
```js
var object = {};
try {
object = JSON.parse("");
} catch {}
var array = object.array || [];
```
Since `JSON.parse("")` returned null instead of throwing, it would set
`object` to null and then try and use it instead of using the default
backup value.
2022-07-10 23:31:48 +02:00
Timothy Flynn
bf85bf2a9e
LibJS: Use Intl.PluralRules within Intl.RelativeFormat
...
The Polish test cases added here cover previous failures from test262,
due to the way that 0 is specified to be "many" in Polish.
2022-07-08 11:51:54 +02:00
Timothy Flynn
36abcd820d
LibJS: Implement Intl.PluralRules.prototype.select
2022-07-08 11:51:54 +02:00
Timothy Flynn
f11cb7c075
LibJS: Populate pluralCategories in Intl.PluralRules.resolvedOptions
2022-07-08 11:51:54 +02:00
Timothy Flynn
b3deec061e
LibJS: Implement Intl.Locale.prototype.weekInfo property
2022-07-06 16:56:42 +02:00
Timothy Flynn
88a560dd84
LibJS: Implement Intl.Locale.prototype.textInfo property
2022-07-06 16:56:42 +02:00
Timothy Flynn
814f13bc2a
LibJS: Implement Intl.Locale.prototype.timeZones property
2022-07-06 16:56:42 +02:00
Timothy Flynn
f6aa6a480c
LibJS: Implement Intl.Locale.prototype.numberingSystems property
2022-07-06 16:56:42 +02:00
Timothy Flynn
ee2be5895f
LibJS: Implement Intl.Locale.prototype.hourCycles property
2022-07-06 16:56:42 +02:00
Timothy Flynn
4d32f38a76
LibJS: Partially implement Intl.Locale.prototype.collations property
...
We do not yet parse collation data from the CLDR. This stubs out the
collations property, analogous to Intl.supportedValuesOf.
2022-07-06 16:56:42 +02:00
Timothy Flynn
e9bc35d805
LibJS: Implement Intl.Locale.prototype.calendars property
2022-07-06 16:56:42 +02:00
Linus Groh
028a6b90b1
LibJS: Revert partial resizable ArrayBuffer implementation
...
This is a manual but clean revert of all commits from #12595 .
Adding a partial implementation of the resizable ArrayBuffer proposal
without implementing all the updates to TypedArray infrastructure that
is also covered by the spec introduced a bunch of crashes, so we
decided to revert it for now until a full implementation is completed.
2022-07-06 15:52:57 +02:00
Linus Groh
28a3c064c5
LibJS/Tests: Disable one Array.prototype.toSpliced test for now
...
It keeps failing on i686, and will until we've updated a bunch of size_t
APIs in the codebase to u64.
2022-07-04 18:50:35 +02:00
Linus Groh
4b70ddf5a0
LibJS: Let Array.prototype.toSpliced throw RangeError for len <= 2^53-1
...
This aligns it with the spec again, it was clarified that the additional
range check before ArrayCreate is intentional:
https://github.com/tc39/proposal-change-array-by-copy/issues/94
Also cast the final variable to an u64 instead of size_t after we have
determined that it is safe to do so, as that's what Array::create()
takes now.
2022-07-04 10:10:11 +02:00
Obinna Ikeh
5f726ace53
LibJS: Add tests for %TypedArray%.prototype.toReversed
2022-07-03 01:12:32 +02:00
Idan Horowitz
1ebc5af2f0
LibJS: Set both {minimum, maximum}FractionDigits in Intl.DurationFormat
...
This is a normative change in the Intl.DurationFormat spec.
See: b293603e
2022-07-02 18:32:35 +03:00
Idan Horowitz
fb8c4a724e
LibJS: Disallow mixed-sign durations in Intl.DurationFormat
...
This is a normative change in the Intl.DurationFormat spec.
See: 89ab1855
2022-07-02 18:32:35 +03:00
Idan Horowitz
b6b8356c0c
LibJS: Implement Intl.DurationFormat.prototype.formatToParts
2022-07-01 01:00:05 +03:00
Idan Horowitz
706ff5ac83
LibJS: Implement Intl.DurationFormat.prototype.format
2022-07-01 01:00:05 +03:00
Idan Horowitz
d9a4b3e46a
LibJS: Implement Intl.DurationFormat.prototype.resolvedOptions
2022-07-01 01:00:05 +03:00
Idan Horowitz
b20ef7d640
LibJS: Implement Intl.DurationFormat.supportedLocalesOf
2022-07-01 01:00:05 +03:00
Idan Horowitz
97fe37bcc2
LibJS: Start implementing the stage 3 Intl.DurationFormat proposal
2022-07-01 01:00:05 +03:00
Obinna Ikeh
104330d1a0
LibJS: Add tests cases for %TypedArray%.prototype.toSorted function
2022-06-29 13:36:54 +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:
- caf013a
- fb7cfa6
2022-06-29 07:35:42 +01:00
Cyber Gsus
f97e664d8f
LibJS: Check for add overflow in DataViewConstructor
...
Use the Checked type from AK to verify that offset + view_byte_length
is buffer_byte_length at most.
2022-06-27 20:51:00 +01:00
Linus Groh
3beb7fc42f
LibJS/Tests: Correct pluralSmallestPluralDisallowedOptions largestUnit
2022-06-24 22:12:03 +01:00
Idan Horowitz
a79796ea4a
LibJS: Implement stage 3 proposal FinalizationRegistry changes
...
Specifically the 'Symbol as WeakMap Keys Proposal'.
2022-06-23 10:57:52 +03:00
Idan Horowitz
53ed8decaf
LibJS: Implement WeakRef changes from 'Symbol as WeakMap Keys Proposal'
2022-06-23 10:57:52 +03:00
Idan Horowitz
dbd0110721
LibJS: Implement WeakSet changes from 'Symbol as WeakMap Keys Proposal'
2022-06-23 10:57:52 +03:00
Idan Horowitz
a80d3fdf49
LibJS: Implement WeakMap changes from 'Symbol as WeakMap Keys Proposal'
2022-06-23 10:57:52 +03:00
Linus Groh
d9fc09c6e5
LibJS/Tests: Remove outdated FIXME
2022-06-17 21:06:01 +01:00
Linus Groh
569c2dc1d0
LibJS: Adjust order of operations in ISO{Date,MonthDay}FromFields
...
This is a normative change in the Temporal spec.
See: 7dd90dc
2022-06-15 17:49:20 +01:00
Linus Groh
e96df3b7a7
LibJS: Leverage PrepareTemporalFields in ToTemporalTimeRecord
...
This is an editorial change in the Temporal spec.
See: b5ba981
2022-06-15 17:49:20 +01:00
Linus Groh
698062b831
LibJS: Implement Array.prototype.with()
2022-06-13 20:26:54 +01:00
Linus Groh
ae81793f20
LibJS: Implement Array.prototype.toSpliced()
2022-06-13 20:26:54 +01:00
Linus Groh
ce17c868c0
LibJS: Implement Array.prototype.toSorted()
2022-06-13 20:26:54 +01:00
Linus Groh
e4370b7d82
LibJS: Implement Array.prototype.toReversed()
2022-06-13 20:26:54 +01:00
Linus Groh
013e2df858
LibJS: Rename Array.prototype.groupBy{,ToMap} => group{,ToMap}
...
This is a normative change in the Array Grouping spec.
See: 0cf4077
2022-06-13 20:05:24 +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
stelar7
771e3b9868
LibJS: Stub out String.prototype.normalize
2022-06-02 23:04:27 +01:00
Luke Wilde
2b764b3594
LibJS: Remove faulty assertion in BalanceDurationRelative
...
This is an editorial change in the Temporal spec.
See: 66f7464
2022-05-16 20:48:41 +01:00
Linus Groh
51e01b5a80
LibJS: Remove redundant TemporalDateString production
...
This is an editorial change in the Temporal spec.
See: 41a8a5c
2022-05-16 20:28:26 +01:00
Linus Groh
b751f80166
LibJS: Change internal slots of Duration to store mathematical values
...
This is a normative change in the Temporal spec.
See: 1f3fba8
2022-05-08 01:01:32 +02:00
Idan Horowitz
9098257668
LibJS: Reject -00000 as extended year in Date parsing
2022-04-30 21:36:27 +02:00
Timothy Flynn
4d0315099f
LibJS: Allow TypeArray to become detached in TypedArray.prototype.set
...
This is a normative change in the ECMA-262 spec. See:
4d570c4
2022-04-13 16:02:01 +02:00