browser/devtools/webconsole/test/test-closures.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/webconsole/test/test-closures.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +  <head>
     1.7 +    <meta charset='utf-8'/>
     1.8 +    <title>Console Test for Closure Inspection</title>
     1.9 +    <!-- Any copyright is dedicated to the Public Domain.
    1.10 +         http://creativecommons.org/publicdomain/zero/1.0/ -->
    1.11 +    <script type="text/javascript">
    1.12 +      function injectPerson() {
    1.13 +        var PersonFactory = function _pfactory(name) {
    1.14 +            var foo = 10;
    1.15 +            return {
    1.16 +              getName: function() { return name; },
    1.17 +              getFoo: function() { foo = Date.now(); return foo; }
    1.18 +            };
    1.19 +        };
    1.20 +        window.george = new PersonFactory("George");
    1.21 +        debugger;
    1.22 +      }
    1.23 +    </script>
    1.24 +
    1.25 +  </head>
    1.26 +  <body>
    1.27 +    <button onclick="injectPerson()">Test</button>
    1.28 +  </body>
    1.29 +</html>

mercurial