3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
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 {...}";
28 throw new Error("An exception");
30 let block2
= "catch(e) {...}";
36 return n
+ makeClosureLocalVar
+ x
+ innerFunctionLocalVar
+ innerFunctionBlockVar
+
37 makeClosureBlockVar
+ makeClosureDeeperBlockVar
+ makeClosureDeeperLocalVar
;
42 function testFunction()
44 var f
= makeClosure("TextParam");
50 InspectorTest
.startDebuggerTest(step1
);
54 InspectorTest
.runTestFunctionAndWaitUntilPaused(step2
);
59 InspectorTest
.expandScopeVariablesSidebarPane(step3
);
64 InspectorTest
.addResult("");
65 InspectorTest
.dumpScopeVariablesSidebarPane();
66 InspectorTest
.completeDebuggerTest();
73 <body onload=
"runTest()">
74 <input type='button' onclick='testFunction()' value='Test'
/>
76 Tests ES6 harmony scope sections.