mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
LibJS: Implement String.prototype.endsWith with UTF-16 code units
This commit is contained in:
parent
d2e63a641f
commit
bdbe716547
Notes:
sideshowbarker
2024-07-18 08:35:24 +09:00
Author: https://github.com/trflynn89
Commit: bdbe716547
Pull-request: https://github.com/SerenityOS/serenity/pull/8897
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/davidot
2 changed files with 25 additions and 14 deletions
|
@ -40,3 +40,11 @@ test("basic functionality", () => {
|
|||
);
|
||||
expect(s.endsWith("bar", undefined)).toBeTrue();
|
||||
});
|
||||
|
||||
test("UTF-16", () => {
|
||||
var s = "😀";
|
||||
expect(s.endsWith("😀")).toBeTrue();
|
||||
expect(s.endsWith("\ud83d")).toBeFalse();
|
||||
expect(s.endsWith("\ude00")).toBeTrue();
|
||||
expect(s.endsWith("a")).toBeFalse();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue