Timothy Flynn
cc3b96743a
LibJS: Implement Atomics.add
2021-07-14 20:44:42 +01:00
Timothy Flynn
a61723ec59
LibJS: Begin implementing Atomics
...
This adds the Atomics object to the global object and sets up only its
@@toStringTag property.
2021-07-14 20:44:42 +01:00
Idan Horowitz
84b028bd71
LibJS: Add Temporal.Instant.prototype.round()
...
As well as the required Abstract Operations.
2021-07-12 19:05:17 +01:00
Idan Horowitz
2382f67e0b
LibJS: Add Temporal.Instant.prototype.equals()
2021-07-12 19:05:17 +01:00
Idan Horowitz
84403ab423
LibJS: Add Temporal.Instant.from()
2021-07-12 19:05:17 +01:00
Idan Horowitz
33cf6274e8
LibJS: Add Temporal.Instant.compare()
2021-07-12 19:05:17 +01:00
Linus Groh
54e1180f61
LibJS: Uncomment Number.isInteger() tests that now pass :^)
2021-07-11 22:03:04 +01:00
Linus Groh
1856400547
LibJS: Uncomment Object.{freeze,seal}() tests that now pass :^)
2021-07-11 21:58:14 +01:00
Linus Groh
a647f0abf6
LibJS: Make parse_simplified_iso8601() use Optional<int> instead of -1
...
...for the non-success state. This fixes a crash when parsing dates with
the year -1, as we would assert successful parsing ("year != -1").
Mixing Optional and -1 seems worse and more complicated than just using
Optional for all the values, so I did that instead.
2021-07-10 19:51:07 +01:00
Linus Groh
39cdffd78d
LibJS: Make Date.now() return a floor()'d milliseconds value
...
It is defined as follows:
21.4.3.1 Date.now ( )
https://tc39.es/ecma262/#sec-date.now
The now function returns the time value designating the UTC date and
time of the occurrence of the call to now.
"Time value" is defined as:
21.4.1.1 Time Values and Time Range
https://tc39.es/ecma262/#sec-time-values-and-time-range
An ECMAScript time value is a Number, either a finite integral
Number representing an instant in time to millisecond precision or
NaN representing no specific instant.
By flooring the value we match the behavior in the Temporal proposal's
Temporal.ZonedDateTime.prototype.epochMilliseconds getter:
4. Let ms be RoundTowardsZero(ℝ(ns) / 10^6).
With that being defined as:
13.30 RoundTowardsZero ( x )
https://tc39.es/proposal-temporal/#sec-temporal-roundtowardszero
1. Return the mathematical value that is the same sign as x and
whose magnitude is floor(abs(x)).
This is makes the last of the currently 15 Temporal tests in test262
work, which compares Temporal.now.instant() with Date.now() :^)
2021-07-10 19:51:07 +01:00
Timothy Flynn
6c67de8186
LibJS: Implement RegExp.prototype.hasIndices proposal
...
https://tc39.es/proposal-regexp-match-indices/
2021-07-10 16:49:35 +01:00
Timothy Flynn
d1e06b00e3
LibJS: Parse the RegExp.prototype.hasIndices flag
2021-07-10 16:49:35 +01:00
Idan Horowitz
a44de7a55f
LibJS: Add %TypedArray%.prototype.toLocaleString
2021-07-09 22:32:25 +01:00
Timothy Flynn
e4124d0218
LibJS: Implement RegExp.prototype [ @@split ]
2021-07-09 19:45:55 +01:00
Timothy Flynn
3892b6e6ec
LibJS: Implement RegExp constructor according to the spec
...
This allows passing an existing RegExp object (or an object that is
sufficiently like a RegExp object) as the "pattern" argument of the
RegExp constructor.
2021-07-09 19:45:55 +01:00
Idan Horowitz
52aa777d49
LibJS: Add %TypedArray%.prototype.sort
2021-07-09 16:15:42 +01:00
Idan Horowitz
f98a98506f
LibJS: Add %TypedArray%.prototype.subarray
2021-07-09 16:15:42 +01:00
Idan Horowitz
ff052a3241
LibJS: Add %TypedArray%.prototype.slice
2021-07-09 16:15:42 +01:00
Linus Groh
ca71d99c66
LibJS: Implement Temporal.Instant.fromEpochNanoseconds()
2021-07-09 13:20:51 +01:00
Linus Groh
5872357b56
LibJS: Implement Temporal.Instant.fromEpochMicroseconds()
2021-07-09 13:20:51 +01:00
Linus Groh
66ff772254
LibJS: Implement Temporal.Instant.fromEpochMilliseconds()
2021-07-09 13:20:51 +01:00
Linus Groh
2401e45720
LibJS: Implement Temporal.Instant.fromEpochSeconds()
2021-07-09 13:20:51 +01:00
Linus Groh
3014e529be
LibJS: Tweak error message in the NumberToBigInt abstract operation
...
This is no longer specific to the BigInt() constructor, so it shouldn't
be mentioning an 'argument' that we might not have.
2021-07-09 13:20:51 +01:00
Linus Groh
9f2dd89446
LibJS/Tests: Add tests for Date.prototype.toTemporalInstant()
2021-07-09 13:20:51 +01:00
Luke
1da06f9dfd
LibJS: Add %TypedArray%.prototype.map
2021-07-09 10:15:45 +01:00
Luke
bc6f619344
LibJS: Add TypedArraySpeciesCreate and %TypedArray%.prototype.filter
...
I'm not too happy with how I get the default constructor in
typed_array_species_create, but it works for now.
2021-07-09 10:15:45 +01:00
Linus Groh
6531485251
LibJS/Tests: Add tests for Temporal.Instant() constructor
2021-07-08 23:08:27 +01:00
Linus Groh
117323f2d9
LibJS: Implement Temporal.Instant.prototype.epochNanoseconds
2021-07-08 23:08:27 +01:00
Linus Groh
b5d0cdc97e
LibJS: Implement Temporal.Instant.prototype.epochMicroseconds
2021-07-08 23:08:27 +01:00
Linus Groh
b157ab3f12
LibJS: Implement Temporal.Instant.prototype.epochMilliseconds
2021-07-08 23:08:27 +01:00
Linus Groh
5010e01223
LibJS: Implement Temporal.Instant.prototype.epochSeconds
2021-07-08 23:08:27 +01:00
Linus Groh
dad336c944
LibJS: Implement Temporal.Instant.prototype[@@toStringTag]
2021-07-08 23:08:27 +01:00
Linus Groh
439b35dc7d
LibJS/Tests: Add tests for Temporal.TimeZone() constructor
2021-07-08 23:08:27 +01:00
Linus Groh
51c581f604
LibJS: Implement Temporal.TimeZone.prototype.id
2021-07-08 23:08:27 +01:00
Linus Groh
7f0fe352e2
LibJS: Implement Temporal.TimeZone.prototype.toJSON()
2021-07-08 23:08:27 +01:00
Linus Groh
8d00504ff2
LibJS: Implement Temporal.TimeZone.prototype.toString()
2021-07-08 23:08:27 +01:00
Linus Groh
2e968700aa
LibJS: Implement Temporal.TimeZone.prototype[@@toStringTag]
2021-07-08 23:08:27 +01:00
Idan Horowitz
241f9f21d4
LibJS: Add %TypedArray%.prototype.reduceRight
2021-07-08 16:30:09 +01:00
Idan Horowitz
2356382938
LibJS: Add %TypedArray%.prototype.reduce
2021-07-08 16:30:09 +01:00
Idan Horowitz
f0abcde00c
LibJS: Add %TypedArray%.prototype.lastIndexOf
2021-07-08 16:30:09 +01:00
Idan Horowitz
6343bfa9d7
LibJS: Add %TypedArray%.prototype.indexOf
2021-07-08 16:30:09 +01:00
Idan Horowitz
da49a7a9f8
LibJS: Add %TypedArray%.prototype.includes
2021-07-08 16:30:09 +01:00
Idan Horowitz
3b9886949f
LibJS: Add %TypedArray%.prototype.fill
2021-07-08 16:30:09 +01:00
Luke
c7a839bb24
LibJS: Add %TypedArray%.prototype.copyWithin
...
This fixes 44 test262 cases.
2021-07-08 15:12:52 +01:00
Timothy Flynn
35a2ba8ed8
LibJS: Implement RegExp.prototype [ @@search ]
...
String.prototype.search is already implemented, but relies on the well-
known Symbol.search, which was not implemented.
2021-07-08 00:01:20 +01:00
Timothy Flynn
2d0589f93c
LibJS: Implement global RegExp.prototype.match
...
Also rename the 'rx' variable to 'regexp_object' to match other RegExp
methods.
2021-07-08 00:01:20 +01:00
Timothy Flynn
b6b5adb47d
LibJS: Implement RegExp.prototype.match with RegExpExec abstraction
2021-07-08 00:01:20 +01:00
Timothy Flynn
ec898a3370
LibJS: Implement RegExp.prototype.replace with RegExpExec abstraction
...
Also rename the 'rx' variable to 'regexp_object' to match other RegExp
methods.
2021-07-08 00:01:20 +01:00
Timothy Flynn
6c53475143
LibJS: Implement RegExp.prototype.test with RegExpExec abstraction
2021-07-08 00:01:20 +01:00
davidot
7310713d11
LibJS: Remove fast array paths in ArrayPrototype::{pop, push}
...
Unfortunately this fast path leads to problems if Array.prototype is
changed. We probably need to find out some way to optimize these methods
by detecting changes to the prototype or other mechanisms.
2021-07-07 21:24:26 +01:00