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

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: Created 6 years, 4 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
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
28 class DeferredLibrary { 14 class DeferredLibrary {
floitsch 2014/08/28 20:05:20 Any plan on when we want to remove the class?
sigurdm 2014/09/02 11:23:18 I think version 1.8 (after talking to seth)
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

Powered by Google App Engine
This is Rietveld 408576698