Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: sdk/lib/async/deferred_load.dart

Issue 429883002: Remove support for the DeferredLibrary annotation and remove tests of it (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Deprecated until sdk 1.8 remove cruft from unused DeferredLibrary Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * This class is obsolete. Instead use the syntax:
11 * 11 * import "library.dart" deferred as prefix;
12 * Example usage:
13 *
14 * @lazy
15 * import 'foo.dart' as foo;
16 *
17 * const lazy = const DeferredLibrary('com.example.foo');
18 *
19 * void main() {
20 * foo.method(); // Throws a NoSuchMethodError, foo is not loaded yet.
21 * lazy.load().then(onFooLoaded);
22 * }
23 *
24 * void onFooLoaded(_) {
25 * foo.method();
26 * }
27 */ 12 */
13 @Deprecated("Dart sdk v. 1.8")
28 class DeferredLibrary { 14 class DeferredLibrary {
29 final String libraryName; 15 final String libraryName;
30 final String uri; 16 final String uri;
31 17
32 const DeferredLibrary(this.libraryName, {this.uri}); 18 const DeferredLibrary(this.libraryName, {this.uri});
33 19
34 /** 20 /**
35 * Ensure that [libraryName] has been loaded. 21 * Ensure that [libraryName] has been loaded.
36 * 22 *
37 * If the library fails to load, the Future will complete with a 23 * If the library fails to load, the Future will complete with a
38 * DeferredLoadException. 24 * DeferredLoadException.
39 */ 25 */
40 external Future<Null> load(); 26 external Future<Null> load();
41 } 27 }
42 28
43 /** 29 /**
44 * Thrown when a deferred library fails to load. 30 * Thrown when a deferred library fails to load.
45 */ 31 */
46 class DeferredLoadException implements Exception { 32 class DeferredLoadException implements Exception {
47 DeferredLoadException(String this._s); 33 DeferredLoadException(String this._s);
48 String toString() => "DeferredLoadException: '$_s'"; 34 String toString() => "DeferredLoadException: '$_s'";
49 final String _s; 35 final String _s;
50 } 36 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698