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

LibJS: Use undefined as the fallback value for iterable entry key/value

As defined in OdinaryGet in the specification.
This commit is contained in:
Idan Horowitz 2021-06-12 23:24:20 +03:00 committed by Linus Groh
parent c0e04768e0
commit 3c83298a26
2 changed files with 11 additions and 2 deletions

View file

@ -32,3 +32,11 @@ describe("normal behavior", () => {
expect(a instanceof WeakMap).toBeTrue();
});
});
describe("regressions", () => {
test("missing key/value properties on iterable entry", () => {
expect(() => {
new WeakMap([{}]);
}).toThrowWithMessage(TypeError, "undefined is not an object");
});
});