OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Regression test for issue 21795. |
| 6 |
| 7 foo(t) { |
| 8 try { |
| 9 if (t == 123) throw 42; |
| 10 } finally { } |
| 11 } |
| 12 |
| 13 bar() { |
| 14 try { |
| 15 return 42; |
| 16 } finally { } |
| 17 } |
| 18 |
| 19 |
| 20 class A { |
| 21 test(t) { |
| 22 try { |
| 23 foo(t); |
| 24 } finally { |
| 25 if (t == 0) { |
| 26 try { |
| 27 } catch (err, st) { |
| 28 } |
| 29 } |
| 30 } |
| 31 } |
| 32 } |
| 33 |
| 34 |
| 35 main() { |
| 36 var a = new A(); |
| 37 for (var i=0; i<10000; ++i) a.test(0); |
| 38 try { |
| 39 a.test(123); |
| 40 } catch (e, s) { |
| 41 if (s.toString().indexOf("foo") == -1) { |
| 42 print(s); |
| 43 throw "Expected foo in stacktrace!"; |
| 44 } |
| 45 } |
| 46 } |
OLD | NEW |