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
commit 0b0f1eda05
Notes: sideshowbarker 2024-07-18 12:34:14 +09:00
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]);
});
});