| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.async; | 5 part of dart.async; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Indicates that loading of [libraryName] is deferred. | 8 * Indicates that loading of [libraryName] is deferred. |
| 9 * | 9 * |
| 10 * Applies to library imports, when used as metadata. | 10 * Applies to library imports, when used as metadata. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 */ | 27 */ |
| 28 class DeferredLibrary { | 28 class DeferredLibrary { |
| 29 final String libraryName; | 29 final String libraryName; |
| 30 final String uri; | 30 final String uri; |
| 31 | 31 |
| 32 const DeferredLibrary(this.libraryName, {this.uri}); | 32 const DeferredLibrary(this.libraryName, {this.uri}); |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * Ensure that [libraryName] has been loaded. | 35 * Ensure that [libraryName] has been loaded. |
| 36 * | 36 * |
| 37 * The value of the returned future is true if this invocation of | |
| 38 * [load] caused the library to be loaded. | |
| 39 * | |
| 40 * If the library fails to load, the Future will complete with a | 37 * If the library fails to load, the Future will complete with a |
| 41 * DeferredLoadException. | 38 * DeferredLoadException. |
| 42 */ | 39 */ |
| 43 external Future<bool> load(); | 40 external Future<Null> load(); |
| 44 } | 41 } |
| 45 | 42 |
| 46 /** | 43 /** |
| 47 * Thrown when a deferred library fails to load. | 44 * Thrown when a deferred library fails to load. |
| 48 */ | 45 */ |
| 49 class DeferredLoadException implements Exception { | 46 class DeferredLoadException implements Exception { |
| 50 DeferredLoadException(String this._s); | 47 DeferredLoadException(String this._s); |
| 51 String toString() => "DeferredLoadException: '$_s'"; | 48 String toString() => "DeferredLoadException: '$_s'"; |
| 52 final String _s; | 49 final String _s; |
| 53 } | 50 } |
| OLD | NEW |