summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting.html
blob: 726aaea23ab4116dd88e6e5192bbc3f4029bd228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!doctype html>
<meta charset=utf-8>
<title>[[SetPrototypeOf]] on a location object should return false</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
  test(function() {
    var origProto = Object.getPrototypeOf(location);
    assert_throws(new TypeError, function() {
      Object.setPrototypeOf(location, {});
    });
    assert_throws(new TypeError, function() {
      location.__proto__ = {};
    });
    assert_false(Reflect.setPrototypeOf(location, {}));
    assert_equals(Object.getPrototypeOf(location), origProto);
  });
</script>