| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 // A deferred library that doesn't exist. | 6 // A deferred library that doesn't exist. |
| 7 import 'package:foo/foo.dart' deferred as foo; | 7 import 'package:foo/foo.dart' deferred as foo; |
| 8 // A deferred library that does exist. | 8 // A deferred library that does exist. |
| 9 import 'deferred/exists.dart' deferred as exists; | 9 import 'deferred/exists.dart' deferred as exists; |
| 10 // A deferred library that transitively will fail due to a file not found. | 10 // A deferred library that transitively will fail due to a file not found. |
| 11 import 'deferred/transitive_error.dart' deferred as te; | 11 import 'deferred/transitive_error.dart' deferred as te; |
| 12 | 12 |
| 13 main() async { | 13 main() async { |
| 14 // Attempt to load foo which will fail. | 14 // Attempt to load foo which will fail. |
| 15 var fooError; | 15 var fooError; |
| 16 await foo.loadLibrary().catchError((e) { | 16 await foo.loadLibrary().catchError((e) { |
| 17 fooError = e; | 17 fooError = e; |
| 18 }); | 18 }); |
| 19 Expect.isNotNull(fooError); | 19 Expect.isNotNull(fooError); |
| 20 await exists.loadLibrary(); | 20 await exists.loadLibrary(); |
| 21 Expect.equals(99, exists.x); | 21 Expect.equals(99, exists.x); |
| 22 /* TODO(johnmccutchan): Implement transitive error reporting. | 22 /* TODO(johnmccutchan): Implement transitive error reporting. |
| 23 var teError; | 23 var teError; |
| 24 await te.loadLibrary().catchError((e) { | 24 await te.loadLibrary().catchError((e) { |
| 25 teError = e; | 25 teError = e; |
| 26 }); | 26 }); |
| 27 Expect.isNotNull(teError); | 27 Expect.isNotNull(teError); |
| 28 */ | 28 */ |
| 29 } | 29 } |
| OLD | NEW |