tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

interface-object-set-receiver.html (1250B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>window.Interface is defined on [[Set]] receiver</title>
      4 <link rel="help" href="https://webidl.spec.whatwg.org/#define-the-global-property-references">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script>
      8 "use strict";
      9 const testValue = Object.freeze(function() {});
     10 
     11 test(() => {
     12  window.Window = testValue;
     13  assert_false(window.propertyIsEnumerable("Window"));
     14 
     15  window.History = testValue;
     16  assert_false(window.propertyIsEnumerable("History"));
     17 
     18  window.HTMLDivElement = testValue;
     19  assert_false(window.propertyIsEnumerable("HTMLDivElement"))
     20 }, "Direct [[Set]] preserves [[Enumerable]]: false property attribute");
     21 
     22 test(() => {
     23  const heir = Object.create(window);
     24 
     25  heir.Location = testValue;
     26  assert_equals(heir.Location, testValue);
     27  assert_not_equals(window.Location, testValue);
     28 
     29  heir.HTMLDocument = testValue;
     30  assert_equals(heir.HTMLDocument, testValue);
     31  assert_not_equals(window.HTMLDocument, testValue);
     32 
     33  heir.HTMLPreElement = testValue;
     34  assert_equals(heir.HTMLPreElement, testValue);
     35  assert_not_equals(window.HTMLPreElement, testValue);
     36 }, "Prototype chain [[Set]] creates property on receiver");
     37 </script>