blob: a281cdac4d7c241c6006053e467c5e32162bd2cf [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests that using defineProperty() on a custom accessor");
evalAndLog('oldDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")');
shouldBeType("oldDescriptor.get", "Function");
shouldBeType("oldDescriptor.set", "Function");
shouldBeTrue('oldDescriptor.enumerable');
shouldBeTrue('oldDescriptor.configurable');
function newGetter() { }
function newSetter() { }
debug('');
evalAndLog('Object.defineProperty(HTMLInputElement.prototype, "value", { get: newGetter, set: newSetter, enumerable: false, configurable: false })');
debug('');
evalAndLog('newDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")');
shouldBe("newDescriptor.get", "newGetter");
shouldBe("newDescriptor.set", "newSetter");
shouldBeFalse('newDescriptor.enumerable');
shouldBeFalse('newDescriptor.configurable');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>