OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 @AssumeDynamic() | 7 @AssumeDynamic() |
8 @NoInline() | 8 @NoInline() |
9 foo() => 1; | 9 foo() => 1; |
10 | 10 |
11 @AssumeDynamic() | 11 @AssumeDynamic() |
12 @NoInline() | 12 @NoInline() |
13 throwException() => throw 'x'; | 13 throwException() => throw 'x'; |
14 | 14 |
15 main() { | 15 main() { |
16 var x = 10; | 16 var x = 10; |
17 var e2 = null; | 17 var e2 = null; |
18 try { | 18 try { |
19 var t = foo(); | 19 var t = foo(); |
20 throwException(); | 20 throwException(); |
21 print(t); | 21 print(t); |
22 x = 3; | 22 x = 3; |
23 } catch (e) { | 23 } catch (e) { |
24 Expect.equals(10, x); | 24 Expect.equals(10, x); |
25 e2 = e; | 25 e2 = e; |
26 } | 26 } |
27 Expect.equals(10, x); | 27 Expect.equals(10, x); |
28 Expect.equals('x', e2); | 28 Expect.equals('x', e2); |
29 } | 29 } |
OLD | NEW |