| 6 | |
| 7 | function test (binding) { |
| 8 | function testDeleteProperty (nativeDeleteProperty) { |
| 9 | const obj = { one: 1, two: 2 }; |
| 10 | Object.defineProperty(obj, 'three', { configurable: false, value: 3 }); |
| 11 | assert.strictEqual(nativeDeleteProperty(obj, 'one'), true); |
| 12 | assert.strictEqual(nativeDeleteProperty(obj, 'missing'), true); |
| 13 | |
| 14 | /* Returns true for all cases except when the property is an own non- |
| 15 | configurable property, in which case, false is returned in non-strict mode. */ |
| 16 | assert.strictEqual(nativeDeleteProperty(obj, 'three'), false); |
| 17 | assert.deepStrictEqual(obj, { two: 2 }); |
| 18 | } |
| 19 | |
| 20 | function testShouldThrowErrorIfKeyIsInvalid (nativeDeleteProperty) { |
| 21 | assert.throws(() => { |