Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger / debugger-es6-harmony-scopes.html
blob9c302a8703a6b397c5a7b3d2c173b7d7f4fb2f68
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script>
6 "use strict";
8 let globalLet = 41;
9 const globalConst = 42;
11 function makeClosure(n)
13 let makeClosureBlockVar = "block." + n;
14 var makeClosureLocalVar = "local." + n;
16 let makeClosureDeeperBlockVar = "block.deep." + n;
17 var makeClosureDeeperLocalVar = "local.deep." + n;
18 return function innerFunction(x)
20 let innerFunctionBlockVar = x + 102;
21 var innerFunctionLocalVar = x + 2;
22 var negInf = -Infinity;
23 var negZero = 1 / negInf;
25 let block1 = "block {...}";
26 const const1 = 1;
27 try {
28 throw new Error("An exception");
29 } catch (e) {
30 let block2 = "catch(e) {...}";
31 const const2 = 2;
32 e.toString();
33 debugger;
36 return n + makeClosureLocalVar + x + innerFunctionLocalVar + innerFunctionBlockVar +
37 makeClosureBlockVar + makeClosureDeeperBlockVar + makeClosureDeeperLocalVar;
42 function testFunction()
44 var f = makeClosure("TextParam");
45 f(2014);
48 function test()
50 InspectorTest.startDebuggerTest(step1);
52 function step1()
54 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
57 function step2()
59 InspectorTest.expandScopeVariablesSidebarPane(step3);
62 function step3()
64 InspectorTest.addResult("");
65 InspectorTest.dumpScopeVariablesSidebarPane();
66 InspectorTest.completeDebuggerTest();
70 </script>
71 </head>
73 <body onload="runTest()">
74 <input type='button' onclick='testFunction()' value='Test'/>
75 <p>
76 Tests ES6 harmony scope sections.
77 </p>
78 </body>
79 </html>