browser/devtools/debugger/test/doc_closures.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 Closure Inspection</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           var PersonFactory = function _pfactory(name) {
    14               var foo = 10;
    15               return {
    16                 getName: function() { return name; },
    17                 getFoo: function() { foo = Date.now(); return foo; }
    18               };
    19           };
    20           var person = new PersonFactory("Bob");
    21           debugger;
    22         }
    23         var button = document.querySelector("button");
    24         button.addEventListener("click", clickHandler, false);
    25       });
    26     </script>
    28   </head>
    29   <body>
    30     <button>Click me!</button>
    31   </body>
    32 </html>

mercurial