| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Flags: --expose-debug-as debug | |
| 6 | |
| 7 var exception = null; | |
| 8 | |
| 9 function listener(event, exec_state, event_data, data) { | |
| 10 if (event != debug.Debug.DebugEvent.Break) return; | |
| 11 try { | |
| 12 var all_scopes = exec_state.frame().allScopes(); | |
| 13 assertEquals([ debug.ScopeType.Block, | |
| 14 debug.ScopeType.Local, | |
| 15 debug.ScopeType.Script, | |
| 16 debug.ScopeType.Global ], | |
| 17 all_scopes.map(scope => scope.scopeType())); | |
| 18 } catch (e) { | |
| 19 exception = e; | |
| 20 print(e); | |
| 21 } | |
| 22 } | |
| 23 | |
| 24 debug.Debug.setListener(listener); | |
| 25 | |
| 26 (function(arg, ...rest) { | |
| 27 var one = 1; | |
| 28 function inner() { | |
| 29 one; | |
| 30 arg; | |
| 31 } | |
| 32 debugger; | |
| 33 })(); | |
| 34 | |
| 35 debug.Debug.setListener(null); | |
| 36 assertNull(exception); | |
| OLD | NEW |