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:
parent
727031ac1b
commit
22f20cd51d
4 changed files with 31 additions and 0 deletions
|
@ -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");
|
||||
|
|
16
Libraries/LibJS/Tests/String.prototype.toUpperCase.js
Normal file
16
Libraries/LibJS/Tests/String.prototype.toUpperCase.js
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue