Debian Codegraph @

js/src/tests/test262/staging/set-is-subset-table-receiver-cleared.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 receiver is cleared.
5 features: [set-methods]
6 ---*/
7
8 const firstSet = new Set();
9 firstSet.add(42);
10 firstSet.add(43);
11
12 const otherSet = new Set();
13 otherSet.add(42);
14 otherSet.add(43);
15 otherSet.add(47);
16
17 Object.defineProperty(otherSet, 'size', {
18 get: function() {
19 firstSet.clear();
20 return 3;
21 },
22
23 });
24
25 assert.sameValue(firstSet.isSubsetOf(otherSet), true);
26
27 reportCompare(0, 0);