OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Document has an unforgeable attribute location</title> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 // https://html.spec.whatwg.org/#document |
| 7 // https://heycam.github.io/webidl/#Unforgeable |
| 8 test(function() { |
| 9 assert_true(document.hasOwnProperty("location"), "property exist on the obje
ct itself"); |
| 10 var descriptor = Object.getOwnPropertyDescriptor(document, "location"); |
| 11 assert_false(descriptor.configurable, "property is not configurable"); |
| 12 assert_throws(new TypeError(), function() { |
| 13 Object.defineProperty(document, "location", {get: function () {}}); |
| 14 }, "attempting to modify property throws TypeError"); |
| 15 }); |
| 16 </script> |
OLD | NEW |