OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, 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 // VMOptions=--optimization-counter-threshold=10 --no-use-osr |
| 5 |
| 6 import "package:expect/expect.dart"; |
| 7 |
| 8 // Test unboxed double operations inside try-catch. |
| 9 foo(bool b) { |
| 10 if (b) throw 123; |
| 11 } |
| 12 |
| 13 test_double(double x, bool b) { |
| 14 try { |
| 15 x += 1.0; |
| 16 foo(b); |
| 17 } catch (e) { |
| 18 var result = x - 1.0; |
| 19 Expect.equals(1.0, result); |
| 20 return result; |
| 21 } |
| 22 } |
| 23 |
| 24 main() { |
| 25 for (var i=0; i<100; i++) test_double(1.0, false); |
| 26 test_double(1.0, false); |
| 27 Expect.equals(1.0, test_double(1.0, true)); |
| 28 } |
| 29 |
OLD | NEW |