tor-browser

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

invalid-uncompiled-raw-handler-keeps-position.window.js (730B)


      1 setup({ allow_uncaught_exception: true });
      2 
      3 test(function() {
      4  var events = [];
      5  window.onerror = function() {
      6    events.push("error");
      7  };
      8 
      9  var div = document.createElement("div");
     10  div.addEventListener("click", function (e) { events.push("click 1"); });
     11  div.setAttribute("onclick", "}");
     12  div.addEventListener("click", function (e) { events.push("click 3"); });
     13  assert_equals(div.onclick, null);
     14  assert_array_equals(events, ["error"]);
     15 
     16  events = [];
     17  div.onclick = function (e) { events.push("click 2"); };
     18  div.dispatchEvent(new Event("click"));
     19  assert_array_equals(events, ["click 1", "click 2", "click 3"]);
     20 }, "Compiling invalid uncompiled raw handlers should keep the position in event listener list");