summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/test-closures.html
blob: 4fadade20791c8ebf7e03021dfcab2494d2e05d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE HTML>
<html>
  <head>
    <meta charset='utf-8'/>
    <title>Console Test for Closure Inspection</title>
    <!-- Any copyright is dedicated to the Public Domain.
         http://creativecommons.org/publicdomain/zero/1.0/ -->
    <script type="text/javascript">
      function injectPerson() {
        var PersonFactory = function _pfactory(name) {
            var foo = 10;
            return {
              getName: function() { return name; },
              getFoo: function() { foo = Date.now(); return foo; }
            };
        };
        window.george = new PersonFactory("George");
        debugger;
      }
    </script>

  </head>
  <body>
    <button onclick="injectPerson()">Test</button>
  </body>
</html>