| Tests that using defineProperty() does not clear existing setter if the new descriptor only has a getter |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| oldDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value") |
| PASS oldDescriptor.get is an instance of Function |
| PASS oldDescriptor.set is an instance of Function |
| PASS oldDescriptor.enumerable is true |
| PASS oldDescriptor.configurable is true |
| |
| Override only the getter |
| Object.defineProperty(HTMLInputElement.prototype, "value", { get: newGetter }) |
| |
| newDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value") |
| PASS newDescriptor.get is newGetter |
| PASS newDescriptor.set is oldDescriptor.set |
| PASS newDescriptor.enumerable is true |
| PASS newDescriptor.configurable is true |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |