blob: 32d1d34673a9b40060106168a92577e9d8205fe8 [file] [log] [blame]
var obj = { get a() { return 1; } };
assertThrowsInstanceOf(() => {
new Object.getOwnPropertyDescriptor(obj, "a").get
}, TypeError);
obj = { set a(b) { } };
assertThrowsInstanceOf(() => {
new Object.getOwnPropertyDescriptor(obj, "a").set
}, TypeError);
obj = { get a() { return 1; }, set a(b) { } };
assertThrowsInstanceOf(() => {
new Object.getOwnPropertyDescriptor(obj, "a").get
}, TypeError);
assertThrowsInstanceOf(() => {
new Object.getOwnPropertyDescriptor(obj, "a").set
}, TypeError);
if (typeof reportCompare === "function")
reportCompare(true, true);