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 Debug = debug.Debug | |
8 | |
9 var exception = null; | |
10 | |
11 var f = () => { debugger; } | |
12 var g = function() { debugger; } | |
13 var h = (function() { return () => { debugger; }; }).call({}); | |
14 | |
15 function listener(event, exec_state, event_data, data) { | |
16 if (event != Debug.DebugEvent.Break) return; | |
17 try { | |
18 assertThrows(() => exec_state.frame(0).evaluate("this = 2")); | |
19 } catch (e) { | |
20 exception = e; | |
21 print("Caught something. " + e + " " + e.stack); | |
22 }; | |
23 }; | |
24 | |
25 Debug.setListener(listener); | |
26 | |
27 f(); | |
28 g(); | |
29 g.call({}); | |
30 h(); | |
31 | |
32 Debug.setListener(null); | |
33 assertNull(exception); | |
OLD | NEW |