OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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: --ignition --turbo |
| 6 |
| 7 function f() { |
| 8 throw new Error(); |
| 9 } |
| 10 |
| 11 function g() { |
| 12 try { |
| 13 f(); |
| 14 } catch (e) { |
| 15 return 1; // Break |
| 16 } |
| 17 } |
| 18 |
| 19 function h() { |
| 20 return g(); |
| 21 } |
| 22 |
| 23 h(); |
| 24 h(); |
| 25 |
| 26 var Debug = debug.Debug; |
| 27 var step_count = 0; |
| 28 var exception = null; |
| 29 |
| 30 function listener(event, exec_state, event_data, data) { |
| 31 if (event == Debug.DebugEvent.Exception) { |
| 32 step_count++; |
| 33 exec_state.prepareStep(Debug.StepAction.StepNext); |
| 34 } else if (event == Debug.DebugEvent.Break) { |
| 35 step_count++; |
| 36 try { |
| 37 assertTrue(exec_state.frame().sourceLineText().includes('Break')); |
| 38 } catch (e) { |
| 39 exception = e; |
| 40 print(e); |
| 41 } |
| 42 } |
| 43 } |
| 44 |
| 45 Debug.setListener(listener); |
| 46 Debug.setBreakOnException(); |
| 47 % OptimizeFunctionOnNextCall(h); |
| 48 h(); |
| 49 Debug.setListener(null); |
| 50 assertNull(exception); |
OLD | NEW |