tor-browser

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

test-closure-optimized-out.html (1054B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <head>
      4    <meta charset='utf-8'/>
      5    <title>Debugger Test for Inspecting Optimized-Out Variables</title>
      6    <!-- Any copyright is dedicated to the Public Domain.
      7         http://creativecommons.org/publicdomain/zero/1.0/ -->
      8    <script type="text/javascript">
      9        /* eslint-disable */
     10        window.addEventListener("load", function () {
     11        function clickHandler(event) {
     12          button.removeEventListener("click", clickHandler);
     13          function outer(arg) {
     14            let upvar = arg * 2;
     15            // The inner lambda only aliases arg, so the frontend alias analysis decides
     16            // that upvar is not aliased and is not in the CallObject.
     17            return function () {
     18              arg += 2;
     19            };
     20          }
     21 
     22          let f = outer(42);
     23          f();
     24        }
     25        let button = document.querySelector("button");
     26        button.addEventListener("click", clickHandler);
     27      }, {once: true});
     28    </script>
     29 
     30  </head>
     31  <body>
     32    <button>Click me!</button>
     33  </body>
     34 </html>