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

Unified Diff: sdk/lib/mirrors/mirrors.dart

Issue 922023002: Implement DeclarationMirror.location for all but ParameterMirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/mirrors/mirrors.dart
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index d16e62eecb7fc4e63e4518e7ffd4398b8c562fda..224e8799638de4577ff37fcb4880296fb352485e 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -286,9 +286,35 @@ abstract class DeclarationMirror implements Mirror {
bool get isTopLevel;
/**
- * The source location of this Dart language entity.
+ * The source location of this Dart language entity, or [:null:] if the
+ * entity is synthetic.
*
- * This operation is optional and may return [:null:].
+ * If the reflectee is a variable, the returned location gives the position of * the variable name at its point of declaration.
+ *
+ * If the reflectee is a library, class, typedef, function or type variable
+ * with associated metadata, the returned location gives the position of the
+ * first metadata declaration associated with the reflectee.
+ *
+ * Otherwise:
+ * If the reflectee is a library, the returned location gives the position of
+ * the keyword 'library' at the reflectee's point of declaration, if the
+ * reflectee is a named library, or the first character of the first line in
+ * the compilation unit defining the reflectee if the reflectee is anonymous.
+ *
+ * If the reflectee is an abstract class, the returned location gives the
+ * position of the keyword 'abstract' at the reflectee's point of declaration. * Otherwise, if the reflectee is a class, the returned location gives the
+ * position of the keyword 'class' at the reflectee's point of declaration.
+ *
+ * If the reflectee is a typedef the returned location gives the position of
+ * the of the keyword 'typedef' at the reflectee's point of declaration.
+ *
+ * If the reflectee is a function with a declared return type, the returned
+ * location gives the position of the function's return type at the
+ * reflectee's point of declaration. Otherwise. the returned location gives
+ * the position of the function's name at the reflectee's point of
+ * declaration.
+ *
+ * This operation is optional and may throw an [UnsupportedError].
*/
SourceLocation get location;
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698