Commit Graph

1015 Commits

Author SHA1 Message Date
Timothy Flynn
860417fb4f LibJS: Ensure RegExpStringIterator keeps the RegExp matcher object alive
Fixes a crash found with 'test-js -g' due to this object going out of
scope.
2021-07-16 20:44:48 +02:00
Idan Horowitz
8d01d43f5e LibJS: Replace the boolean argument of Object::set with an enum class
This is more serenity-esque and also makes pointing out missing
exception checks during reviews much easier.
2021-07-16 17:50:01 +01:00
Idan Horowitz
4b39e718b3 LibJS: Remove unused Object::PutOwnPropertyMode enum class
All usages of this enum class were removed in the Object rewrite, but
this enum was left behind.
2021-07-16 17:50:01 +01:00
Timothy Flynn
4812b95795 LibJS: Implement RegExp AdvanceStringIndex abstraction
This isn't particularly useful yet because the underlying LibRegex
engine doesn't support unicode matching yet. But the debt of FIXMEs
related to AdvanceStringIndex have added up, so let's get this out of
the way.
2021-07-16 13:53:11 +01:00
Timothy Flynn
5135f4000c LibJS: Implement RegExp.prototype [ @@matchAll ]
This also allows String.prototype.matchAll to work, as all calls to that
method result in an invocation to @@matchAll.
2021-07-16 13:53:11 +01:00
Timothy Flynn
cfddcad7cf LibJS: Implement the RegExpStringIterator object
This implementation closely follows the StringIterator object in that
the abstract closure meant to be created in CreateRegExpStringIterator
is instead unrolled into RegExpStringIterator.prototype.next.
2021-07-16 13:53:11 +01:00
Timothy Flynn
6cf64d0f09 LibJS: Make the RegExpExec abstraction publically available
For RegExpStringIterator, this will be needed outside of the RegExp
prototype.
2021-07-16 13:53:11 +01:00
Linus Groh
9d7e391f94 LibJS/Tests: Add test for Temporal.Instant.prototype.valueOf() 2021-07-16 01:07:01 +01:00
Linus Groh
8daf35e1b1 LibJS: Implement Temporal.Duration.prototype.valueOf() 2021-07-16 01:07:01 +01:00
Linus Groh
a06b034a9a LibJS: Implement Temporal.Duration.prototype.blank 2021-07-16 01:07:01 +01:00
Linus Groh
3713164fa3 LibJS: Implement Temporal.Duration.prototype.sign 2021-07-16 01:07:01 +01:00
Linus Groh
be5254dcac LibJS: Implement Temporal.Duration.prototype.nanoseconds 2021-07-16 01:07:01 +01:00
Linus Groh
04e2d215a1 LibJS: Implement Temporal.Duration.prototype.microseconds 2021-07-16 01:07:01 +01:00
Linus Groh
db22f86055 LibJS: Implement Temporal.Duration.prototype.milliseconds 2021-07-16 01:07:01 +01:00
Linus Groh
b81331a110 LibJS: Implement Temporal.Duration.prototype.seconds 2021-07-16 01:07:01 +01:00
Linus Groh
dbdbfbeebc LibJS: Implement Temporal.Duration.prototype.minutes 2021-07-16 01:07:01 +01:00
Linus Groh
067c2346ed LibJS: Implement Temporal.Duration.prototype.hours 2021-07-16 01:07:01 +01:00
Linus Groh
2015640168 LibJS: Implement Temporal.Duration.prototype.days 2021-07-16 01:07:01 +01:00
Linus Groh
23d0c3494f LibJS: Implement Temporal.Duration.prototype.weeks 2021-07-16 01:07:01 +01:00
Linus Groh
8011409428 LibJS: Implement Temporal.Duration.prototype.months 2021-07-16 01:07:01 +01:00
Linus Groh
300a22f9b9 LibJS: Implement Temporal.Duration.prototype.years 2021-07-16 01:07:01 +01:00
Linus Groh
23766f28db LibJS: Implement Temporal.Duration.prototype[@@toStringTag] 2021-07-16 01:07:01 +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
Linus Groh
466c5bc96d LibJS: Implement Temporal.Calendar.prototype.id 2021-07-14 23:50:03 +01:00
Linus Groh
3ee169d8e7 LibJS: Implement Temporal.Calendar.prototype.toJSON() 2021-07-14 23:50:03 +01:00
Linus Groh
83bbbbe567 LibJS: Implement Temporal.Calendar.prototype.toString() 2021-07-14 23:50:03 +01:00
Linus Groh
e01c6adab4 LibJS: Implement Temporal.Calendar.prototype[@@toStringTag] 2021-07-14 23:50:03 +01:00
Linus Groh
a2f1d79765 LibJS: Start implementing Temporal.Calendar
Just like the previous Temporal.{Instant,TimeZone} commits, this patch
adds the Calendar object itself, its constructor and prototype
(currently empty), and two required abstract operations.
2021-07-14 23:50:03 +01:00
Linus Groh
48b66c7a68 LibJS: Put Temporal.Instant.prototype member definitions in spec order 2021-07-14 23:50:03 +01:00
Linus Groh
6c8f0fbb35 LibJS: Use more specific return types for some Temporal AOs
Instead of returning Object* we should be specific and return Instant*,
TimeZone* etc.
2021-07-14 23:50:03 +01:00
Timothy Flynn
1a3e1bff7b LibJS: Implement Atomics.isLockFree 2021-07-14 22:13:15 +01:00
Timothy Flynn
33eb830929 LibJS: Implement Atomics.compareExchange 2021-07-14 22:13:15 +01:00
Timothy Flynn
655ffce64d LibJS: Implement Atomics.exchange 2021-07-14 22:13:15 +01:00
Timothy Flynn
6211eb0f9a LibJS: Implement Atomics.store 2021-07-14 20:44:42 +01:00
Timothy Flynn
b6364ec899 LibJS: Implement Atomics.xor 2021-07-14 20:44:42 +01:00
Timothy Flynn
d2f6255b91 LibJS: Implement Atomics.sub 2021-07-14 20:44:42 +01:00
Timothy Flynn
f9d8e234b2 LibJS: Implement Atomics.or 2021-07-14 20:44:42 +01:00
Timothy Flynn
2d3af5c1b4 LibJS: Implement Atomics.and 2021-07-14 20:44:42 +01:00
Timothy Flynn
940875c9fd LibJS: Implement Atomics.load 2021-07-14 20:44:42 +01:00
Timothy Flynn
cc3b96743a LibJS: Implement Atomics.add 2021-07-14 20:44:42 +01:00
Timothy Flynn
ba2c3731e9 LibJS: Make ValidateTypeArray abstraction public
Also adds a typed_array_from helper for casting a known value to a
TypedArray.
2021-07-14 20:44:42 +01:00
Timothy Flynn
4f8f79c5ca LibJS: Add some TypedArray abstractions for querying underlying type
IsUnclampedIntegerElementType and IsBigIntElementType.
2021-07-14 20:44:42 +01:00
Timothy Flynn
f4ea6b1824 LibJS: Implement TypedArray GetModifySetValueInBuffer abstract operation 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
Timothy Flynn
df75c35d5b LibJS: Alphabetically sort LibJS's CMakeLists.txt 2021-07-14 20:44:42 +01:00
Daniel Bertalan
cd55b817cf LibJS: Use AK::abs in TimeZone
This fixes a `-Wabsolute-value` warning emitted because of our use of
`abs()` on arguments of type `long long`.
2021-07-14 13:12:25 +02:00
Idan Horowitz
804d592303 LibJS: Add missing has_constructor override to Generator Functions 2021-07-13 20:40:57 +02: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
01c731aa59 LibJS: Add the GetOptionsObject & GetOption Temporal AbstractOperations
These are used by any Temporal method that accepts an options object.
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