1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:47:34 +00:00

LibJS: Add most of the Set.prototype methods

Specifically all aside from "values" and "entries" which require an
implementation of the SetIterator object.
This commit is contained in:
Idan Horowitz 2021-06-09 00:14:08 +03:00 committed by Linus Groh
parent 670be04c81
commit 0b0f1eda05
9 changed files with 164 additions and 0 deletions

View file

@ -27,5 +27,10 @@ describe("normal behavior", () => {
var a = new Set([0, 1, 2]);
expect(a instanceof Set).toBeTrue();
expect(a).toHaveSize(3);
var seen = [false, false, false];
a.forEach(x => {
seen[x] = true;
});
expect(seen[0] && seen[1] && seen[2]);
});
});