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 'regress_22443_lib.dart' deferred as D; | 5 import 'regress_22443_lib.dart' deferred as D; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 | 7 |
8 int fooCount = 0; | 8 int fooCount = 0; |
9 | 9 |
10 foo() { | 10 foo() { |
11 fooCount++; | 11 fooCount++; |
12 return new D.LazyClass(); | 12 return new D.LazyClass(); |
13 } | 13 } |
14 | 14 |
15 main() { | 15 main() { |
16 var caughtIt = false; | 16 var caughtIt = false; |
17 try { foo(); } catch (e) { caughtIt = true; }; | 17 try { |
| 18 foo(); |
| 19 } catch (e) { |
| 20 caughtIt = true; |
| 21 } |
| 22 ; |
18 D.loadLibrary().then((_) { | 23 D.loadLibrary().then((_) { |
19 foo(); | 24 foo(); |
20 Expect.isTrue(caughtIt); | 25 Expect.isTrue(caughtIt); |
21 Expect.equals(2, fooCount); | 26 Expect.equals(2, fooCount); |
22 }); | 27 }); |
23 } | 28 } |
OLD | NEW |