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

Side by Side Diff: sdk/lib/mirrors/mirrors.dart

Issue 14178010: Change libraries map to use Uri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test updated Created 7 years, 8 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // For the purposes of the mirrors library, we adopt a naming 5 // For the purposes of the mirrors library, we adopt a naming
6 // convention with respect to getters and setters. Specifically, for 6 // convention with respect to getters and setters. Specifically, for
7 // some variable or field... 7 // some variable or field...
8 // 8 //
9 // var myField; 9 // var myField;
10 // 10 //
(...skipping 17 matching lines...) Expand all
28 * of libraries which are not running -- perhaps at compile-time. In 28 * of libraries which are not running -- perhaps at compile-time. In
29 * this case, all available reflective functionality would be 29 * this case, all available reflective functionality would be
30 * supported, but runtime functionality (such as invoking a function 30 * supported, but runtime functionality (such as invoking a function
31 * or inspecting the contents of a variable) would fail dynamically. 31 * or inspecting the contents of a variable) would fail dynamically.
32 */ 32 */
33 abstract class MirrorSystem { 33 abstract class MirrorSystem {
34 /** 34 /**
35 * An immutable map from from library names to mirrors for all 35 * An immutable map from from library names to mirrors for all
36 * libraries known to this mirror system. 36 * libraries known to this mirror system.
37 */ 37 */
38 // TODO(ahe): [libraries] should be Map<Uri, LibraryMirror>. 38 Map<Uri, LibraryMirror> get libraries;
39 Map<Symbol, LibraryMirror> get libraries; 39
40 /**
41 * Returns an iterable of all libraries in the mirror system whose library
42 * name is [libraryName].
43 */
44 Iterable<LibraryMirror> findLibrary(Symbol libraryName) {
45 return libraries.values.where(
46 (library) => library.simpleName == libraryName);
47 }
40 48
41 /** 49 /**
42 * A mirror on the isolate associated with this [MirrorSystem]. 50 * A mirror on the isolate associated with this [MirrorSystem].
43 * This may be null if this mirror system is not running. 51 * This may be null if this mirror system is not running.
44 */ 52 */
45 IsolateMirror get isolate; 53 IsolateMirror get isolate;
46 54
47 /** 55 /**
48 * A mirror on the [:dynamic:] type. 56 * A mirror on the [:dynamic:] type.
49 */ 57 */
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 /** 827 /**
820 * Is [:true:] if this comment is a documentation comment. 828 * Is [:true:] if this comment is a documentation comment.
821 * 829 *
822 * That is, that the comment is either enclosed in [: /** ... */ :] or starts 830 * That is, that the comment is either enclosed in [: /** ... */ :] or starts
823 * with [: /// :]. 831 * with [: /// :].
824 */ 832 */
825 final bool isDocComment; 833 final bool isDocComment;
826 834
827 const Comment(this.text, this.trimmedText, this.isDocComment); 835 const Comment(this.text, this.trimmedText, this.isDocComment);
828 } 836 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/isolate_mirror_local_test.dart ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698