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

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE HTML>
     2 <html>
     3   <head>
     4     <meta charset='utf-8'/>
     5     <title>Console 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       function injectPerson() {
    10         var PersonFactory = function _pfactory(name) {
    11             var foo = 10;
    12             return {
    13               getName: function() { return name; },
    14               getFoo: function() { foo = Date.now(); return foo; }
    15             };
    16         };
    17         window.george = new PersonFactory("George");
    18         debugger;
    19       }
    20     </script>
    22   </head>
    23   <body>
    24     <button onclick="injectPerson()">Test</button>
    25   </body>
    26 </html>

mercurial