browser/devtools/debugger/test/doc_closure-optimized-out.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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       window.addEventListener("load", function onload() {
    10         window.removeEventListener("load", onload);
    11         function clickHandler(event) {
    12           button.removeEventListener("click", clickHandler, false);
    13           function outer(arg) {
    14             var 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           }
    22           var f = outer(42);
    23           f();
    24         }
    25         var button = document.querySelector("button");
    26         button.addEventListener("click", clickHandler, false);
    27       });
    28     </script>
    30   </head>
    31   <body>
    32     <button>Click me!</button>
    33   </body>
    34 </html>

mercurial