Bug 1708160 - Move non262/Set/ tests to jit-tests. r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D113646
This commit is contained in:
Jan de Mooij 2021-04-29 13:58:14 +00:00
parent b8169aa81e
commit bf23b5f907
9 changed files with 8 additions and 53 deletions

View File

@ -3,17 +3,9 @@
* http://creativecommons.org/licenses/publicdomain/
*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 722260;
var summary = 'All NaNs must be treated as identical keys for Set';
// All NaNs must be treated as identical keys for Set.
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
/* Avoid constant-folding that would happen were |undefined| to be used. */
// Avoid constant-folding that would happen were |undefined| to be used.
var key = -/a/g.missingProperty;
var s = new Set();
@ -46,11 +38,3 @@ s.delete(key);
assertEq(s.has(key), false);
assertEq(s.has(-key), false);
assertEq(s.has(NaN), false);
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");

View File

@ -3,15 +3,7 @@
* http://creativecommons.org/licenses/publicdomain/
*/
//-----------------------------------------------------------------------------
var BUGNUMBER = 987243;
var summary = "Don't use .call(...) in the self-hosted Set.prototype.forEach";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
// Don't use .call(...) in the self-hosted Set.prototype.forEach
var functionCall = Function.prototype.call;
@ -42,10 +34,3 @@ new Set([new Number]).forEach(lalala);
new Set([true, new Boolean(false)]).forEach(lalala);
assertEq(callCount, 0);
/******************************************************************************/
if (typeof reportCompare === "function")
reportCompare(true, true);
print("Tests complete");

View File

@ -0,0 +1,3 @@
// Set getters should have get prefix
assertEq(Object.getOwnPropertyDescriptor(Set, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(Set.prototype, "size").get.name, "get size");

View File

@ -17,6 +17,3 @@ for (var thisv of [null, undefined, false, true, 0, ""]) {
test(Set.prototype.keys, thisv);
test(Set.prototype[Symbol.iterator], thisv);
}
if (typeof reportCompare === "function")
reportCompare(0, 0);

View File

@ -5,6 +5,3 @@ try {
} catch (e) {
assertEq(e.message, "1 is not iterable");
}
if (typeof reportCompare === "function")
reportCompare(0, 0);

View File

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/ */
load(libdir + "asserts.js");
var s = new Set;
// Symbols can be stored in Sets.
@ -22,6 +24,3 @@ var s2 = "how much wood would a woodchuck chuck if could";
var arr = str.split(" ").map(Symbol.for);
s = new Set(arr);
assertDeepEq([...s], s2.split(" ").map(Symbol.for));
if (typeof reportCompare === "function")
reportCompare(0, 0);

View File

@ -1,10 +0,0 @@
var BUGNUMBER = 1180290;
var summary = 'Set getters should have get prefix';
print(BUGNUMBER + ": " + summary);
assertEq(Object.getOwnPropertyDescriptor(Set, Symbol.species).get.name, "get [Symbol.species]");
assertEq(Object.getOwnPropertyDescriptor(Set.prototype, "size").get.name, "get size");
if (typeof reportCompare === 'function')
reportCompare(true, true);