tor-browser

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

interface-objects.html (1124B)


      1 <!DOCTYPE html>
      2 <title>Interfaces</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id="log"></div>
      6 <script>
      7 function testInterfaceDeletable(iface) {
      8  test(function() {
      9    assert_true(!!window[iface], "Interface should exist.")
     10    assert_true(delete window[iface], "The delete operator should return true.")
     11    assert_equals(window[iface], undefined, "Interface should be gone.")
     12  }, "Should be able to delete " + iface + ".")
     13 }
     14 var interfaces = [
     15  "Event",
     16  "CustomEvent",
     17  "EventTarget",
     18  "AbortController",
     19  "AbortSignal",
     20  "Node",
     21  "Document",
     22  "DOMImplementation",
     23  "DocumentFragment",
     24  "ProcessingInstruction",
     25  "DocumentType",
     26  "Element",
     27  "Attr",
     28  "CharacterData",
     29  "Text",
     30  "Comment",
     31  "NodeIterator",
     32  "TreeWalker",
     33  "NodeFilter",
     34  "NodeList",
     35  "HTMLCollection",
     36  "DOMTokenList"
     37 ];
     38 test(function() {
     39  for (var p in window) {
     40    interfaces.forEach(function(i) {
     41      assert_not_equals(p, i)
     42    })
     43  }
     44 }, "Interface objects properties should not be Enumerable")
     45 interfaces.forEach(testInterfaceDeletable);
     46 </script>