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: GetSetRecord allows instances of Set-like classes
8 1. If obj is not an Object, throw a TypeError exception.
9 2. Let rawSize be ? Get(obj, "size").
11 7. Let has be ? Get(obj, "has").
13 9. Let keys be ? Get(obj, "keys").
14 features: [set-methods]
15 includes: [compareArray.js]
18 const s1 = new Set([1, 2]);
19 const s2 = new class {
24 throw new Test262Error("Set.prototype.symmetricDifference should not invoke .has on its argument");
31 const expected = [1, 3];
32 const combined = s1.symmetricDifference(s2);
34 assert.compareArray([...combined], expected);
35 assert.sameValue(combined instanceof Set, true, "The returned object is a Set");