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 | 4 |
5 // Flags: --expose-debug-as debug --allow-natives-syntax | |
6 | 5 |
7 // Test debug event catch prediction for thrown exceptions. We distinguish | 6 // Test debug event catch prediction for thrown exceptions. We distinguish |
8 // between "caught" and "uncaught" based on the following assumptions: | 7 // between "caught" and "uncaught" based on the following assumptions: |
9 // 1) try-catch : Will always catch the exception. | 8 // 1) try-catch : Will always catch the exception. |
10 // 2) try-finally : Will always re-throw the exception. | 9 // 2) try-finally : Will always re-throw the exception. |
11 | 10 |
12 Debug = debug.Debug; | 11 Debug = debug.Debug; |
13 | 12 |
14 var log = []; | 13 var log = []; |
15 | 14 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return a + 10; | 133 return a + 10; |
135 } | 134 } |
136 } | 135 } |
137 assertEquals(11, f(1)); | 136 assertEquals(11, f(1)); |
138 assertEquals(12, f(2)); | 137 assertEquals(12, f(2)); |
139 %OptimizeFunctionOnNextCall(f); | 138 %OptimizeFunctionOnNextCall(f); |
140 assertEquals(13, f(3)); | 139 assertEquals(13, f(3)); |
141 print("Collect log:", log); | 140 print("Collect log:", log); |
142 assertEquals([["oops1",true], ["oops2",true], ["oops3",true]], log); | 141 assertEquals([["oops1",true], ["oops2",true], ["oops3",true]], log); |
143 })(); | 142 })(); |
OLD | NEW |