1 // |reftest| skip -- set-methods is not supported
2 // Copyright (C) 2023 Anthony Frehner and Kevin Gibbons. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-set.prototype.symmetricdifference
6 description: Set.prototype.symmetricDifference consumes a set-like array as a set-like, not an array
7 features: [set-methods]
8 includes: [compareArray.js]
11 const s1 = new Set([1, 2]);
14 s2.has = function (v) {
15 throw new Test262Error("Set.prototype.symmetricDifference should not invoke .has on its argument");
17 s2.keys = function () {
18 return [2, 3, 4].values();
21 const expected = [1, 3, 4];
22 const combined = s1.symmetricDifference(s2);
24 assert.compareArray([...combined], expected);
25 assert.sameValue(combined instanceof Set, true, "The returned object is a Set");