Timothy Flynn
06208aaa15
LibJS: Implement String.prototype.replace with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
bdbe716547
LibJS: Implement String.prototype.endsWith with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
d2e63a641f
LibJS: Implement String.prototype.startsWith with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
f920e121b3
LibJS: Implement String.prototype.lastIndexOf with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
5ac964d841
LibJS: Implement String.prototype.slice with UTF-16 code units
...
This also implements String.prototype.slice more closely to the spec
(such as handling indices equivalent to Infinity).
2021-07-22 09:10:44 +02:00
Timothy Flynn
eaa1360eee
LibJS: Implement StringPad abstract operation with UTF-16 code units
...
Affects String.prototype.padStart and String.prototype.padEnd.
2021-07-22 09:10:44 +02:00
Timothy Flynn
ef2ff5f88b
LibJS: Implement String.prototype.at with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
892bfdbbcf
LibJS: Implement String.prototype.substr with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
60d8852fc2
LibJS: Implement String.prototype.substring with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
767700d8a1
LibJS: Implement String.prototype.indexOf with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
70f9c7e1c7
LibJS: Implement String.prototype.includes with UTF-16 code units
...
This also implements String.prototype.includes more closely to the spec
(such as returning false when the search string is a RegExp object).
2021-07-22 09:10:44 +02:00
Timothy Flynn
a05ce330b8
LibJS: Implement String.prototype.codePointAt with UTF-16 code units
...
This also implements the CodePointAt abstract operation. This is needed
to handle invalid code units specific to the JavaScript spec, rather
than e.g. inserting replacement code units. This abstraction is public
because RegExp.prototype will also need it.
2021-07-22 09:10:44 +02:00
Timothy Flynn
48a28a9a73
LibJS: Implement String.prototype.charCodeAt with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
5d11614bc7
LibJS: Implement String.prototype.charAt with UTF-16 code units
2021-07-22 09:10:44 +02:00
Timothy Flynn
2bba20d123
LibJS: Report string properties using UTF-16 code units
...
String length is reported as the number of UTF-16 code units, and string
indices are reported as the UTF-16 code units themselves.
2021-07-22 09:10:44 +02:00
Timothy Flynn
0e25d2393f
LibJS: Add UTF-16 tests to String.prototype methods that already work
...
These methods did not require UTF-16 views, so just add test cases to
ensure they remain correct.
This also adds a couple of FIXME comments on tests that will fail even
with UTF-16 String.prototype support (for reasons such as lack of UTF-16
support in RegExp.prototype and Unicode case folding).
2021-07-22 09:10:44 +02:00
Idan Horowitz
d804ce830d
LibJS: Implement Temporal.PlainDate.prototype.equals & Required AO
2021-07-21 22:49:37 +01:00
Idan Horowitz
1e471e2e2f
LibJS: Add Temporal.Calendar.prototype.dateFromFields & required AOs
...
This is required for implementing the DateFromFields PlainDate AO.
2021-07-21 22:49:37 +01:00
Idan Horowitz
68aad5d8fa
LibJS: Implement Temporal.PlainDate.prototype.valueOf
2021-07-21 22:49:37 +01:00
davidot
a49b47bfe6
LibJS: Fix tests that expected wrong this values
2021-07-20 23:45:28 +02:00
davidot
40b8689f9b
LibJS: Disallow duplicated variable declarations
2021-07-20 23:45:28 +02:00
Linus Groh
feea534dae
LibJS/Tests: Fix typo in Temporal.Instant.compare test description
2021-07-20 17:57:50 +01:00
Idan Horowitz
94322ea985
LibJS: Implement Temporal.PlainDate.prototype.calendar
2021-07-19 09:11:20 +01:00
Idan Horowitz
94e1324a67
LibJS: Implement Temporal.PlainDate.prototype[@@toStringTag]
2021-07-19 09:11:20 +01:00
Idan Horowitz
cc00ccec41
LibJS: Start implementing Temporal.PlainDate
...
This commit adds the PlainDate object itself, its constructor and
prototype (currently empty), and several required abstract operations.
2021-07-19 09:11:20 +01:00
Linus Groh
5c77885873
LibJS: Implement Temporal.Duration.from()
...
...with ParseTemporalDurationString currently TODO()'d.
2021-07-19 00:34:28 +01:00
Peter Bindels
d4113f6028
LibJS: Correct test to work with our strtod on x86_64 & Clang
...
Modify constant to be half a ULP lower so our strtod also parses it
correctly. Needs to have issue associated for actually fully fixing
strtod to be correct, rather than correct-enough.
2021-07-18 12:45:10 +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
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
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