Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Set / prototype / symmetricDifference / combines-same-sets.js
blobb8d2d942bcfe198e987d2499925c2e395535f344
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.
4 /*---
5 esid: sec-set.prototype.symmetricdifference
6 description: Set.prototype.symmetricDifference can combine Sets that have the same content
7 features: [set-methods]
8 includes: [compareArray.js]
9 ---*/
11 const s1 = new Set([1, 2]);
12 const s2 = new Set([1, 2]);
13 const expected = [];
14 const combined = s1.symmetricDifference(s2);
16 assert.compareArray([...combined], expected);
17 assert.sameValue(combined instanceof Set, true, "The returned object is a Set");
18 assert.sameValue(combined === s1, false, "The returned object is a new object");
19 assert.sameValue(combined === s2, false, "The returned object is a new object");
21 reportCompare(0, 0);