| Index: test/mjsunit/harmony/debug-blockscopes.js
|
| diff --git a/test/mjsunit/harmony/debug-blockscopes.js b/test/mjsunit/harmony/debug-blockscopes.js
|
| index e0df71b2dfe9a6df1898b3d0446a889934312e0b..0230e84b5e9ebd91f0d811d3da85cb91e5d502a1 100644
|
| --- a/test/mjsunit/harmony/debug-blockscopes.js
|
| +++ b/test/mjsunit/harmony/debug-blockscopes.js
|
| @@ -202,17 +202,15 @@ function local_block_1() {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.Local,
|
| + CheckScopeChain([debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| CheckScopeContent({}, 0, exec_state);
|
| - CheckScopeContent({}, 1, exec_state);
|
| };
|
| local_block_1();
|
| EndTest();
|
|
|
|
|
| -// Local scope with a parameter.
|
| +// Simple empty block scope in local scope with a parameter.
|
| BeginTest("Local 2");
|
|
|
| function local_2(a) {
|
| @@ -222,10 +220,9 @@ function local_2(a) {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.Local,
|
| + CheckScopeChain([debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| - CheckScopeContent({a:1}, 1, exec_state);
|
| + CheckScopeContent({a:1}, 0, exec_state);
|
| };
|
| local_2(1);
|
| EndTest();
|
| @@ -266,6 +263,72 @@ local_4(1, 2);
|
| EndTest();
|
|
|
|
|
| +// Single variable in a block scope.
|
| +BeginTest("Local 5");
|
| +
|
| +function local_5(a) {
|
| + {
|
| + let x = 5;
|
| + debugger;
|
| + }
|
| +}
|
| +
|
| +listener_delegate = function(exec_state) {
|
| + CheckScopeChain([debug.ScopeType.Block,
|
| + debug.ScopeType.Local,
|
| + debug.ScopeType.Global], exec_state);
|
| + CheckScopeContent({x:5}, 0, exec_state);
|
| + CheckScopeContent({a:1}, 1, exec_state);
|
| +};
|
| +local_5(1);
|
| +EndTest();
|
| +
|
| +
|
| +// Two variables in a block scope.
|
| +BeginTest("Local 6");
|
| +
|
| +function local_6(a) {
|
| + {
|
| + let x = 6;
|
| + let y = 7;
|
| + debugger;
|
| + }
|
| +}
|
| +
|
| +listener_delegate = function(exec_state) {
|
| + CheckScopeChain([debug.ScopeType.Block,
|
| + debug.ScopeType.Local,
|
| + debug.ScopeType.Global], exec_state);
|
| + CheckScopeContent({x:6,y:7}, 0, exec_state);
|
| + CheckScopeContent({a:1}, 1, exec_state);
|
| +};
|
| +local_6(1);
|
| +EndTest();
|
| +
|
| +
|
| +// Two variables in a block scope.
|
| +BeginTest("Local 7");
|
| +
|
| +function local_7(a) {
|
| + {
|
| + {
|
| + let x = 8;
|
| + debugger;
|
| + }
|
| + }
|
| +}
|
| +
|
| +listener_delegate = function(exec_state) {
|
| + CheckScopeChain([debug.ScopeType.Block,
|
| + debug.ScopeType.Local,
|
| + debug.ScopeType.Global], exec_state);
|
| + CheckScopeContent({x:8}, 0, exec_state);
|
| + CheckScopeContent({a:1}, 1, exec_state);
|
| +};
|
| +local_7(1);
|
| +EndTest();
|
| +
|
| +
|
| // Single empty with block.
|
| BeginTest("With block 1");
|
|
|
| @@ -276,8 +339,7 @@ function with_block_1() {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.With,
|
| + CheckScopeChain([debug.ScopeType.With,
|
| debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| CheckScopeContent({}, 0, exec_state);
|
| @@ -299,16 +361,13 @@ function with_block_2() {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.With,
|
| - debug.ScopeType.Block,
|
| + CheckScopeChain([debug.ScopeType.With,
|
| debug.ScopeType.With,
|
| debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| CheckScopeContent({}, 0, exec_state);
|
| CheckScopeContent({}, 1, exec_state);
|
| CheckScopeContent({}, 2, exec_state);
|
| - CheckScopeContent({}, 3, exec_state);
|
| };
|
| with_block_2();
|
| EndTest();
|
| @@ -324,12 +383,10 @@ function with_block_3() {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.With,
|
| + CheckScopeChain([debug.ScopeType.With,
|
| debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| - CheckScopeContent({}, 0, exec_state);
|
| - CheckScopeContent({a:1,b:2}, 1, exec_state);
|
| + CheckScopeContent({a:1,b:2}, 0, exec_state);
|
| };
|
| with_block_3();
|
| EndTest();
|
| @@ -347,19 +404,39 @@ function with_block_4() {
|
| }
|
|
|
| listener_delegate = function(exec_state) {
|
| - CheckScopeChain([debug.ScopeType.Block,
|
| - debug.ScopeType.With,
|
| - debug.ScopeType.Block,
|
| + CheckScopeChain([debug.ScopeType.With,
|
| debug.ScopeType.With,
|
| debug.ScopeType.Local,
|
| debug.ScopeType.Global], exec_state);
|
| - CheckScopeContent({a:2,b:1}, 1, exec_state);
|
| - CheckScopeContent({a:1,b:2}, 3, exec_state);
|
| + CheckScopeContent({a:2,b:1}, 0, exec_state);
|
| + CheckScopeContent({a:1,b:2}, 1, exec_state);
|
| };
|
| with_block_4();
|
| EndTest();
|
|
|
|
|
| +// With block and a block local variable.
|
| +BeginTest("With block 5");
|
| +
|
| +function with_block_5() {
|
| + with({a:1}) {
|
| + let a = 2;
|
| + debugger;
|
| + }
|
| +}
|
| +
|
| +listener_delegate = function(exec_state) {
|
| + CheckScopeChain([debug.ScopeType.Block,
|
| + debug.ScopeType.With,
|
| + debug.ScopeType.Local,
|
| + debug.ScopeType.Global], exec_state);
|
| + CheckScopeContent({a:2}, 0, exec_state);
|
| + CheckScopeContent({a:1}, 1, exec_state);
|
| +};
|
| +with_block_5();
|
| +EndTest();
|
| +
|
| +
|
| // Simple closure formed by returning an inner function referering to an outer
|
| // block local variable and an outer function's parameter.
|
| BeginTest("Closure 1");
|
|
|