blob: 9fcdaf1db70e1298e3530c18ffec7631e43f9245 [file] [log] [blame]
<!DOCTYPE html>
<title>Document has an unforgeable attribute location</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
// https://html.spec.whatwg.org/#document
// https://heycam.github.io/webidl/#Unforgeable
test(function() {
assert_true(document.hasOwnProperty("location"), "property exist on the object itself");
var descriptor = Object.getOwnPropertyDescriptor(document, "location");
assert_false(descriptor.configurable, "property is not configurable");
assert_throws_js(TypeError, function() {
Object.defineProperty(document, "location", {get: function () {}});
}, "attempting to modify property throws TypeError");
});
</script>