1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibJS: Add String.prototype.toUpperCase()

This commit is contained in:
Linus Groh 2020-04-07 00:23:17 +01:00 committed by Andreas Kling
parent 727031ac1b
commit 22f20cd51d
4 changed files with 31 additions and 0 deletions

View file

@ -1,4 +1,9 @@
try {
// FIXME: Remove once we have the global String object
var String = { prototype: Object.getPrototypeOf("") };
assert(String.prototype.toLowerCase.length === 0);
assert("foo".toLowerCase() === "foo");
assert("Foo".toLowerCase() === "foo");
assert("FOO".toLowerCase() === "foo");

View file

@ -0,0 +1,16 @@
try {
// FIXME: Remove once we have the global String object
var String = { prototype: Object.getPrototypeOf("") };
assert(String.prototype.toUpperCase.length === 0);
assert("foo".toUpperCase() === "FOO");
assert("Foo".toUpperCase() === "FOO");
assert("FOO".toUpperCase() === "FOO");
assert(('b' + 'a' + + 'n' + 'a').toUpperCase() === "BANANA");
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}