| // This test should not crash. |
| if (typeof propA == "boolean" && truthiness(propA) == truthiness(propB)) |
| throw Error(a.name + "[" + i + "] : " + propA + " != " + b.name + "[" + i + "] : " + propB); |
| function shouldBe(actualDesc, expectedDesc) { |
| compare({ name: "actual", desc: actualDesc }, { name: "expected", desc: expectedDesc }); |
| compare({ name: "expected", desc: expectedDesc }, { name: "actual", desc: actualDesc }); |
| function test(expectedDesc) { |
| var desc = Object.getOwnPropertyDescriptor(new Proxy({a:0}, { |
| getOwnPropertyDescriptor(t,pk) { |
| shouldBe(desc, expectedDesc); |
| test({ configurable:true }); |
| test({ writable:true, configurable:true }); |
| test({ writable:true, enumerable:true, configurable:true }); |
| test({ enumerable:true, configurable:true, get: function() {} }); |
| test({ enumerable:true, configurable:true, set: function() {} }); |