OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 | 4 |
5 // Flags: --expose-debug-as debug --allow-natives-syntax | |
6 | 5 |
7 // Test debug events when we only listen to uncaught exceptions and | 6 // Test debug events when we only listen to uncaught exceptions and |
8 // there is a catch handler for the to-be-rejected Promise. | 7 // there is a catch handler for the to-be-rejected Promise. |
9 // We expect no Exception debug events, since the default reject handler passes | 8 // We expect no Exception debug events, since the default reject handler passes |
10 // the rejection on to a user-defined reject handler. | 9 // the rejection on to a user-defined reject handler. |
11 | 10 |
12 Debug = debug.Debug; | 11 Debug = debug.Debug; |
13 | 12 |
14 var resolve, reject; | 13 var resolve, reject; |
15 var p0 = new Promise(function(res, rej) { resolve = res; reject = rej; }); | 14 var p0 = new Promise(function(res, rej) { resolve = res; reject = rej; }); |
(...skipping 17 matching lines...) Expand all Loading... |
33 function listener(event, exec_state, event_data, data) { | 32 function listener(event, exec_state, event_data, data) { |
34 try { | 33 try { |
35 assertTrue(event != Debug.DebugEvent.Exception); | 34 assertTrue(event != Debug.DebugEvent.Exception); |
36 } catch (e) { | 35 } catch (e) { |
37 %AbortJS(e + "\n" + e.stack); | 36 %AbortJS(e + "\n" + e.stack); |
38 } | 37 } |
39 } | 38 } |
40 | 39 |
41 Debug.setBreakOnUncaughtException(); | 40 Debug.setBreakOnUncaughtException(); |
42 Debug.setListener(listener); | 41 Debug.setListener(listener); |
OLD | NEW |