| OLD | NEW | 
|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 // |  | 
| 5 // Flags: --noanalyze-environment-liveness |  | 
| 6 | 4 | 
| 7 | 5 | 
| 8 var Debug = debug.Debug; | 6 var Debug = debug.Debug; | 
| 9 var exception = null; | 7 var exception = null; | 
| 10 | 8 | 
| 11 function listener(event, exec_state, event_data, data) { | 9 function listener(event, exec_state, event_data, data) { | 
| 12   if (event != Debug.DebugEvent.Break) return; | 10   if (event != Debug.DebugEvent.Break) return; | 
| 13   try { | 11   try { | 
| 14     assertEquals(2, exec_state.frameCount()); | 12     assertEquals(2, exec_state.frameCount()); | 
| 15     assertEquals("a", exec_state.frame(0).localName(0)); | 13     assertEquals("a", exec_state.frame(0).localName(0)); | 
| 16     assertEquals(1, exec_state.frame(0).localValue(0).value()); | 14     assertEquals(1, exec_state.frame(0).localValue(0).value()); | 
| 17     assertEquals(1, exec_state.frame(0).localCount()); | 15     assertEquals(1, exec_state.frame(0).localCount()); | 
| 18   } catch (e) { | 16   } catch (e) { | 
| 19     exception = e; | 17     exception = e; | 
| 20   } | 18   } | 
| 21 } | 19 } | 
| 22 | 20 | 
| 23 function f() { | 21 function f() { | 
| 24   var a = 1; | 22   var a = 1; | 
| 25   { | 23   { | 
| 26     let b = 2; | 24     let b = 2; | 
| 27     debugger; | 25     debugger; | 
| 28   } | 26   } | 
| 29 } | 27 } | 
| 30 | 28 | 
| 31 Debug.setListener(listener); | 29 Debug.setListener(listener); | 
| 32 f(); | 30 f(); | 
| 33 Debug.setListener(null); | 31 Debug.setListener(null); | 
| 34 assertNull(exception); | 32 assertNull(exception); | 
| OLD | NEW | 
|---|