tor-browser

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

specifier-error.html (742B)


      1 <!DOCTYPE html>
      2 <title>Handling of invalid specifiers</title>
      3 
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script>
      7    setup({allow_uncaught_exception: true});
      8 
      9    window.log = [];
     10 
     11    window.addEventListener("error", ev => log.push(ev.error));
     12 
     13    const test_load = async_test(
     14        "Test that invalid module specifier leads to TypeError on window.");
     15    window.addEventListener("load", test_load.step_func_done(ev => {
     16      assert_equals(log.length, 1);
     17      assert_equals(log[0].constructor, TypeError);
     18    }));
     19 
     20    function unreachable() { log.push("unexpected"); }
     21 </script>
     22 <script type="module" src="./bad-module-specifier.js" onerror="unreachable()"></script>