Chromium Code Reviews| Index: LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html |
| diff --git a/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html b/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a98615ea27367226673cb55a71fa0d3855485524 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/sources/debugger/debugger-es6-harmony-scopes.html |
| @@ -0,0 +1,77 @@ |
| +<html> |
| +<head> |
| +<script src="../../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../../http/tests/inspector/debugger-test.js"></script> |
| +<script> |
| +"use strict"; |
| + |
| +let globalLet = 41; |
| +const globalConst = 42; |
| + |
| +function makeClosure(n) |
| +{ |
| + let makeClosureBlockVar = "block." + n; |
| + var makeClosureLocalVar = "local." + n; |
| + { |
| + let makeClosureDeeperBlockVar = "block.deep." + n; |
|
yurys
2014/11/21 13:30:54
I'd also add makeClosureDeeperLocalkVar to check t
aandrey
2014/11/21 13:53:14
Done.
|
| + return function innerFunction(x) |
| + { |
| + let innerFunctionBlockVar = x + 102; |
| + var innerFunctionLocalVar = x + 2; |
| + var negInf = -Infinity; |
| + var negZero = 1 / negInf; |
| + { |
| + let block1 = "block {...}"; |
| + const const1 = 1; |
| + try { |
| + throw new Error("An exception"); |
| + } catch (e) { |
| + let block2 = "catch(e) {...}"; |
| + const const2 = 2; |
| + e.toString(); |
| + debugger; |
| + } |
| + } |
| + return n + makeClosureLocalVar + x + innerFunctionLocalVar + innerFunctionBlockVar + makeClosureBlockVar + makeClosureDeeperBlockVar; |
| + } |
| + } |
| +} |
| + |
| +function testFunction() |
| +{ |
| + var f = makeClosure("TextParam"); |
| + f(2014); |
| +} |
| + |
| +function test() |
| +{ |
| + InspectorTest.startDebuggerTest(step1); |
| + |
| + function step1() |
| + { |
| + InspectorTest.runTestFunctionAndWaitUntilPaused(step2); |
| + } |
| + |
| + function step2() |
| + { |
| + InspectorTest.expandScopeVariablesSidebarPane(step3); |
| + } |
| + |
| + function step3() |
| + { |
| + InspectorTest.addResult(""); |
| + InspectorTest.dumpScopeVariablesSidebarPane(); |
| + InspectorTest.completeDebuggerTest(); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| +<input type='button' onclick='testFunction()' value='Test'/> |
| +<p> |
| +Tests ES6 harmony scope sections. |
| +</p> |
| +</body> |
| +</html> |