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 converts -0𝔽 to +0𝔽
8 7.b.ii If nextValue is -0𝔽, set nextValue to +0𝔽.
9 features: [set-methods]
10 includes: [compareArray.js]
13 const setlikeWithMinusZero = {
16 throw new Test262Error("Set.prototype.symmetricDifference should not invoke .has on its argument");
19 // we use an array here because the Set constructor would normalize away -0
24 const s1 = new Set([1, 2]);
25 let expected = [1, 2, +0];
26 let combined = s1.symmetricDifference(setlikeWithMinusZero);
28 assert.compareArray([...combined], expected);
29 assert.sameValue(combined instanceof Set, true, "The returned object is a Set");