blob: 01f756c001000ab213f783b412c4239d648b581e [file] [log] [blame]
speciesConstructors = [RegExp, Array, Int32Array.__proto__, Map, Set, ArrayBuffer, Promise];
function testSymbolSpeciesOnConstructor(constructor) {
if (constructor[Symbol.species] !== constructor)
throw "Symbol.species should return the constructor for " + constructor.name;
constructor[Symbol.species] = true;
if (constructor[Symbol.species] !== constructor)
throw "Symbol.species was mutable " + constructor.name;
// Symbol.species should be configurable.
Object.defineProperty(constructor, Symbol.species, { value: true });
}
speciesConstructors.forEach(testSymbolSpeciesOnConstructor);