1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibJS: Replace some is_nullish() checks with require_object_coercible()

This commit is contained in:
Linus Groh 2021-06-06 16:27:38 +01:00 committed by Andreas Kling
parent cd12b2aa57
commit 3cfd9f51f7
2 changed files with 13 additions and 22 deletions

View file

@ -30,10 +30,10 @@ test("casts |this| to string", () => {
expect(() => {
String.prototype[Symbol.iterator].call(null);
}).toThrowWithMessage(TypeError, "ToObject on null or undefined");
}).toThrowWithMessage(TypeError, "null cannot be converted to an object");
expect(() => {
String.prototype[Symbol.iterator].call(undefined);
}).toThrowWithMessage(TypeError, "ToObject on null or undefined");
}).toThrowWithMessage(TypeError, "undefined cannot be converted to an object");
});
test("utf8 compatible", () => {