blob: d20021004b532b504d86034786ce0b86783531ba [file] [log] [blame]
description("Verify the various properties of Array.prototype[@@unscopables]");
shouldBeEqualToString("typeof Array.prototype[Symbol.unscopables]", "object");
shouldBe("Object.getPrototypeOf(Array.prototype[Symbol.unscopables])", "null");
shouldBeFalse("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).writable");
shouldBeFalse("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).enumerable");
shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype, Symbol.unscopables).configurable");
let expectedEntries = [
"copyWithin",
"entries",
"fill",
"find",
"findIndex",
"includes",
"keys",
"values"
];
shouldBe("Object.getOwnPropertyNames(Array.prototype[Symbol.unscopables])", "expectedEntries");
shouldBe("Object.getOwnPropertySymbols(Array.prototype[Symbol.unscopables])", "[]");
for (let entry of expectedEntries) {
shouldBeTrue("Array.prototype[Symbol.unscopables][\"" + entry + "\"]");
shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").writable");
shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").enumerable");
shouldBeTrue("Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], \"" + entry + "\").configurable");
}