Chromium Code Reviews| 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..d02c9f6a8e9257e980faa52a9727ad509cc4baa2 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. |
|
Jakob Kummerow
2011/09/01 15:40:10
Forgot to edit the comment?
Steven
2011/09/02 12:43:43
Indeed.
On 2011/09/01 15:40:10, Jakob wrote:
|
| +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,14 +404,12 @@ 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(); |