Linus Groh
08a303172d
LibJS: Extend class 'extends' RHS expression parsing
...
Instead of only parsing a primary expression, we should also allow
member expressions, call expressions, and tagged template literals (and
optional chains, which we don't have yet).
In the spec, all of this is covered by `LeftHandSideExpression`
(https://tc39.es/ecma262/#prod-LeftHandSideExpression ).
2021-07-18 00:17:57 +01:00
Timothy Flynn
a2e734d202
LibJS: Report string length as the code point length, not byte length
...
For example, U+180E is 3 bytes, but should have a string length of 1.
2021-07-17 16:59:59 +01:00
Timothy Flynn
87848cdf7d
AK: Track byte length, rather than code point length, in Utf8View::trim
...
Utf8View::trim uses Utf8View::substring_view to return its result, which
requires the input to be a byte offset/length rather than code point
length.
2021-07-17 16:59:59 +01:00
Linus Groh
86c6e68431
LibJS: Implement Temporal.Duration.prototype.abs()
2021-07-16 21:59:13 +01:00
Linus Groh
7df47bf3fb
LibJS: Implement Temporal.Duration.prototype.negated()
2021-07-16 21:59:13 +01:00
Linus Groh
9aa1e4b885
LibJS: Implement Temporal.Duration.prototype.with()
2021-07-16 21:59:13 +01:00
Linus Groh
510f668ae3
LibJS: Add TokenType::{Debugger,With} to Token::is_identifier_name()
...
Also remove TokenType::Interface, that should be handled elsewhere (as
a 'future reserved word' in strict mode).
2021-07-16 21:59:13 +01:00
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