| <script src="../../resources/js-test-pre.js"></script> |
| description("Test that the toString() stringifier has the right attributes"); |
| function testStringifier(object, isUnforgeable) |
| unforgeable = isUnforgeable; |
| descriptor = Object.getOwnPropertyDescriptor(unforgeable ? object : object.__proto__, "toString"); |
| shouldBeType("descriptor.value", "Function"); |
| shouldBe("descriptor.writable", "!unforgeable"); |
| shouldBeTrue("descriptor.enumerable"); |
| shouldBe("descriptor.configurable", "!unforgeable"); |
| debug("* HTMLAnchorElement"); |
| var anchor = document.createElement("a"); |
| testStringifier(anchor, false); |
| debug("* HTMLAreaElement"); |
| var area = document.createElement("area"); |
| testStringifier(area, false); |
| testStringifier(window.location, true); |
| <script src="../../resources/js-test-post.js"></script> |