mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:18:12 +00:00
LibJS: Make Object::to_string() call the "toString" property if present
This commit is contained in:
parent
a7b21ec0f4
commit
8bfee015bc
4 changed files with 13 additions and 2 deletions
|
@ -3,6 +3,9 @@ try {
|
|||
assert(a.toString() === '1,2,3');
|
||||
assert([].toString() === '');
|
||||
assert([5].toString() === '5');
|
||||
|
||||
assert("rgb(" + [10, 11, 12] + ")" === "rgb(10,11,12)");
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
|
@ -41,7 +41,7 @@ try {
|
|||
new isNaN();
|
||||
} catch(e) {
|
||||
assert(e.name === "TypeError");
|
||||
assert(e.message === "[object NativeFunction] is not a constructor");
|
||||
assert(e.message === "function () {\n [NativeFunction]\n} is not a constructor");
|
||||
}
|
||||
|
||||
console.log("PASS");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue