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

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

Issue 278983004: Improve error messages in MirrorSystem.findLibrary. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « runtime/lib/mirrors_patch.dart ('k') | no next file » | 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 // 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 * Returns an immutable map from URIs to mirrors for all 72 * Returns an immutable map from URIs to mirrors for all
73 * libraries known to this mirror system. 73 * libraries known to this mirror system.
74 */ 74 */
75 Map<Uri, LibraryMirror> get libraries; 75 Map<Uri, LibraryMirror> get libraries;
76 76
77 /** 77 /**
78 * Returns the unique library named [libraryName] if it exists. 78 * Returns the unique library named [libraryName] if it exists.
79 * 79 *
80 * If no unique library exists, an error is thrown. 80 * If no unique library exists, an error is thrown.
81 */ 81 */
82 LibraryMirror findLibrary(Symbol libraryName) { 82 LibraryMirror findLibrary(Symbol libraryName);
83 return libraries.values.singleWhere(
84 (library) => library.simpleName == libraryName);
85 }
86 83
87 /** 84 /**
88 * A mirror on the isolate associated with this [MirrorSystem]. 85 * A mirror on the isolate associated with this [MirrorSystem].
89 * This may be null if this mirror system is not running. 86 * This may be null if this mirror system is not running.
90 */ 87 */
91 IsolateMirror get isolate; 88 IsolateMirror get isolate;
92 89
93 /** 90 /**
94 * A mirror on the [:dynamic:] type. 91 * A mirror on the [:dynamic:] type.
95 */ 92 */
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 * 1216 *
1220 * When used as metadata on an import of "dart:mirrors", this metadata does 1217 * When used as metadata on an import of "dart:mirrors", this metadata does
1221 * not apply to the library in which the annotation is used, but instead 1218 * not apply to the library in which the annotation is used, but instead
1222 * applies to the other libraries (all libraries if "*" is used). 1219 * applies to the other libraries (all libraries if "*" is used).
1223 */ 1220 */
1224 final override; 1221 final override;
1225 1222
1226 const MirrorsUsed( 1223 const MirrorsUsed(
1227 {this.symbols, this.targets, this.metaTargets, this.override}); 1224 {this.symbols, this.targets, this.metaTargets, this.override});
1228 } 1225 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698