summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/staging/set-is-subset-table-receiver-cleared.js
blob: 927f57ac5307db42da8308a48218d16f10f3d0bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// |reftest| skip -- set-methods is not supported
// Copyright (C) 2023 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Test isSubsetOf set method receiver is cleared.
features: [set-methods]
---*/

const firstSet = new Set();
firstSet.add(42);
firstSet.add(43);

const otherSet = new Set();
otherSet.add(42);
otherSet.add(43);
otherSet.add(47);

Object.defineProperty(otherSet, 'size', {
  get: function() {
    firstSet.clear();
    return 3;
  },

});

assert.sameValue(firstSet.isSubsetOf(otherSet), true);

reportCompare(0, 0);