| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 debugger; | 491 debugger; |
| 492 let x = 1; | 492 let x = 1; |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 listener_delegate = function(exec_state) { | 496 listener_delegate = function(exec_state) { |
| 497 CheckScopeChain([debug.ScopeType.Block, | 497 CheckScopeChain([debug.ScopeType.Block, |
| 498 debug.ScopeType.Local, | 498 debug.ScopeType.Local, |
| 499 debug.ScopeType.Script, | 499 debug.ScopeType.Script, |
| 500 debug.ScopeType.Global], exec_state); | 500 debug.ScopeType.Global], exec_state); |
| 501 CheckScopeContent({}, 0, exec_state); | 501 CheckScopeContent({x:undefined}, 0, exec_state); |
| 502 }; | 502 }; |
| 503 uninitialized_1(); | 503 uninitialized_1(); |
| 504 EndTest(); | 504 EndTest(); |
| 505 |
| 506 |
| 507 // Block scopes shadowing |
| 508 BeginTest("Block scopes shadowing 1"); |
| 509 function shadowing_1() { |
| 510 let i = 0; |
| 511 { |
| 512 let i = 5; |
| 513 debugger; |
| 514 assertEquals(27, i); |
| 515 } |
| 516 assertEquals(0, i); |
| 517 debugger; |
| 518 assertEquals(27, i); |
| 519 } |
| 520 |
| 521 listener_delegate = function (exec_state) { |
| 522 exec_state.frame(0).evaluate("i = 27"); |
| 523 } |
| 524 shadowing_1(); |
| 525 EndTest(); |
| 526 |
| 527 |
| 528 // Block scopes shadowing |
| 529 BeginTest("Block scopes shadowing 2"); |
| 530 function shadowing_2() { |
| 531 let i = 0; |
| 532 { |
| 533 let j = 5; |
| 534 debugger; |
| 535 assertEquals(27, j); |
| 536 } |
| 537 assertEquals(0, i); |
| 538 } |
| 539 |
| 540 listener_delegate = function (exec_state) { |
| 541 exec_state.frame(0).evaluate("j = 27"); |
| 542 } |
| 543 shadowing_2(); |
| 544 EndTest(); |
| OLD | NEW |