1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:17:45 +00:00

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).
This commit is contained in:
Timothy Flynn 2021-07-19 17:24:23 -04:00 committed by Andreas Kling
parent 9b83cd1abf
commit 0e25d2393f
6 changed files with 32 additions and 0 deletions

View file

@ -298,6 +298,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::index_of)
// 22.1.3.26 String.prototype.toLowerCase ( ), https://tc39.es/ecma262/#sec-string.prototype.tolowercase
JS_DEFINE_NATIVE_FUNCTION(StringPrototype::to_lowercase)
{
// FIXME: Implement Unicode case folding: https://www.unicode.org/Public/13.0.0/ucd/CaseFolding.txt
auto string = ak_string_from(vm, global_object);
if (!string.has_value())
return {};
@ -307,6 +308,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::to_lowercase)
// 22.1.3.28 String.prototype.toUpperCase ( ), https://tc39.es/ecma262/#sec-string.prototype.touppercase
JS_DEFINE_NATIVE_FUNCTION(StringPrototype::to_uppercase)
{
// FIXME: Implement Unicode case folding: https://www.unicode.org/Public/13.0.0/ucd/CaseFolding.txt
auto string = ak_string_from(vm, global_object);
if (!string.has_value())
return {};