1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// ObjectDefineProperties with non callable accessor throws.
const descriptors = [
{get: 1}, {set: 1},
{get: []}, {set: []},
{get: {}}, {set: {}},
{get: new Number}, {set: new Number},
{get: 1, set: 1},
{get: [], set: []},
{get: {}, set: {}},
{get: new Number, set: new Number},
];
for (const descriptor of descriptors) {
assertThrowsInstanceOf(() => Object.create(null, {x: descriptor}), TypeError);
assertThrowsInstanceOf(() => Object.defineProperties({}, {x: descriptor}), TypeError);
}
reportCompare(true, true);
|