Debian Codegraph @

js/src/tests/test262/staging/set-is-subset-on-set-like.js

raw
1 // Copyright (C) 2023 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 description: Test isSubsetOf set method on a set like with equal size.
5 features: [set-methods]
6 ---*/
7
8 const SetLike = {
9 arr: [42, 44, 45],
10 size: 3,
11 keys() {
12 return this.arr[Symbol.iterator]();
13 },
14 has(key) {
15 return this.arr.indexOf(key) != -1;
16 }
17 };
18
19 const firstSet = new Set();
20 firstSet.add(42);
21 firstSet.add(43);
22 firstSet.add(45);
23
24 assert.sameValue(firstSet.isSubsetOf(SetLike), false);
25
26 reportCompare(0, 0);