|
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 } |
|
21 |
|
22 var f = outer(42); |
|
23 f(); |
|
24 } |
|
25 var button = document.querySelector("button"); |
|
26 button.addEventListener("click", clickHandler, false); |
|
27 }); |
|
28 </script> |
|
29 |
|
30 </head> |
|
31 <body> |
|
32 <button>Click me!</button> |
|
33 </body> |
|
34 </html> |