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

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

Issue 14173005: Update dart:mirrors to use Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/mirrors/mirrors.dart
diff --git a/dart/sdk/lib/mirrors/mirrors.dart b/dart/sdk/lib/mirrors/mirrors.dart
index 9813a0d9a74d553c33f4e6a4fbed692fcbaf84cb..4a4fa4d0558b9e1ce9c651f66fc0b432b69bb39d 100644
--- a/dart/sdk/lib/mirrors/mirrors.dart
+++ b/dart/sdk/lib/mirrors/mirrors.dart
@@ -34,7 +34,7 @@ abstract class MirrorSystem {
* An immutable map from from library names to mirrors for all
* libraries known to this mirror system.
*/
- Map<String, LibraryMirror> get libraries;
+ Map<Symbol, LibraryMirror> get libraries;
gbracha 2013/04/11 18:12:20 So, didn't we just change this to be a map of URIs
ahe 2013/04/11 20:12:27 The CL from Johnni was to modify the copy of this
/**
* A mirror on the isolate associated with this [MirrorSystem].
@@ -115,7 +115,7 @@ abstract class DeclarationMirror implements Mirror {
* entity, such as 'method' for a method [:void method() {...}:] or
* 'mylibrary' for a [:#library('mylibrary');:] declaration.
*/
- String get simpleName;
+ Symbol get simpleName;
/**
* The fully-qualified name for this Dart language entity.
@@ -128,7 +128,7 @@ abstract class DeclarationMirror implements Mirror {
* this is a gray area due to lack of clarity over whether library
* names are unique.
*/
- String get qualifiedName;
+ Symbol get qualifiedName;
/**
* A mirror on the owner of this function. This is the declaration
@@ -181,9 +181,9 @@ abstract class ObjectMirror implements Mirror {
* TODO(turnidge): Handle ambiguous names.
* TODO(turnidge): Handle optional & named arguments.
*/
- Future<InstanceMirror> invokeAsync(String memberName,
+ Future<InstanceMirror> invokeAsync(Symbol memberName,
List<Object> positionalArguments,
- [Map<String,Object> namedArguments]);
+ [Map<Symbol,Object> namedArguments]);
gbracha 2013/04/11 18:12:20 Just an observation: this is an excellent example
ahe 2013/04/11 20:12:27 I agree. I had the same issue when updating Funct
/**
* Invokes a getter and returns a mirror on the result. The getter
@@ -191,7 +191,7 @@ abstract class ObjectMirror implements Mirror {
* method.
*/
/* TODO(turnidge): Handle ambiguous names.*/
- Future<InstanceMirror> getFieldAsync(String fieldName);
+ Future<InstanceMirror> getFieldAsync(Symbol fieldName);
/**
* Invokes a setter and returns a mirror on the result. The setter
@@ -201,7 +201,7 @@ abstract class ObjectMirror implements Mirror {
* [String] or [bool].
*/
/* TODO(turnidge): Handle ambiguous names.*/
- Future<InstanceMirror> setFieldAsync(String fieldName, Object value);
+ Future<InstanceMirror> setFieldAsync(Symbol fieldName, Object value);
}
/**
@@ -263,13 +263,13 @@ abstract class ClosureMirror implements InstanceMirror {
* [String] or [bool].
*/
Future<InstanceMirror> applyAsync(List<Object> positionalArguments,
- [Map<String,Object> namedArguments]);
+ [Map<Symbol,Object> namedArguments]);
/**
* Looks up the value of a name in the scope of the closure. The
* result is a mirror on that value.
*/
- Future<InstanceMirror> findInContext(String name);
+ Future<InstanceMirror> findInContext(Symbol name);
}
/**
@@ -293,37 +293,37 @@ abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
* The members of a library are its top-level classes,
* functions, variables, getters, and setters.
*/
- Map<String, Mirror> get members;
+ Map<Symbol, Mirror> get members;
/**
* An immutable map from names to mirrors for all class
* declarations in this library.
*/
- Map<String, ClassMirror> get classes;
+ Map<Symbol, ClassMirror> get classes;
/**
* An immutable map from names to mirrors for all function, getter,
* and setter declarations in this library.
*/
- Map<String, MethodMirror> get functions;
+ Map<Symbol, MethodMirror> get functions;
/**
* An immutable map from names to mirrors for all getter
* declarations in this library.
*/
- Map<String, MethodMirror> get getters;
+ Map<Symbol, MethodMirror> get getters;
/**
* An immutable map from names to mirrors for all setter
* declarations in this library.
*/
- Map<String, MethodMirror> get setters;
+ Map<Symbol, MethodMirror> get setters;
/**
* An immutable map from names to mirrors for all variable
* declarations in this library.
*/
- Map<String, VariableMirror> get variables;
+ Map<Symbol, VariableMirror> get variables;
}
/**
@@ -360,38 +360,38 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
*
* This does not include inherited members.
*/
- Map<String, Mirror> get members;
+ Map<Symbol, Mirror> get members;
/**
* An immutable map from names to mirrors for all method,
* declarations for this type. This does not include getters and
* setters.
*/
- Map<String, MethodMirror> get methods;
+ Map<Symbol, MethodMirror> get methods;
/**
* An immutable map from names to mirrors for all getter
* declarations for this type.
*/
- Map<String, MethodMirror> get getters;
+ Map<Symbol, MethodMirror> get getters;
/**
* An immutable map from names to mirrors for all setter
* declarations for this type.
*/
- Map<String, MethodMirror> get setters;
+ Map<Symbol, MethodMirror> get setters;
/**
* An immutable map from names to mirrors for all variable
* declarations for this type.
*/
- Map<String, VariableMirror> get variables;
+ Map<Symbol, VariableMirror> get variables;
/**
* An immutable map from names to mirrors for all constructor
* declarations for this type.
*/
- Map<String, MethodMirror> get constructors;
+ Map<Symbol, MethodMirror> get constructors;
/**
* An immutable map from names to mirrors for all type variables for
@@ -399,7 +399,7 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
*
* This map preserves the order of declaration of the type variables.
*/
- Map<String, TypeVariableMirror> get typeVariables;
+ Map<Symbol, TypeVariableMirror> get typeVariables;
/**
* An immutable map from names to mirrors for all type arguments for
@@ -407,7 +407,7 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
*
* This map preserves the order of declaration of the type variables.
*/
- Map<String, TypeMirror> get typeArguments;
+ Map<Symbol, TypeMirror> get typeArguments;
/**
* Is this the original declaration of this type?
@@ -436,9 +436,9 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
* The arguments must be instances of [InstanceMirror], [num],
*/
/* TODO(turnidge): Properly document.*/
- Future<InstanceMirror> newInstanceAsync(String constructorName,
+ Future<InstanceMirror> newInstanceAsync(Symbol constructorName,
List<Object> positionalArguments,
- [Map<String,Object> namedArguments]);
+ [Map<Symbol,Object> namedArguments]);
/**
* Does this mirror represent a class?
@@ -569,7 +569,7 @@ abstract class MethodMirror implements DeclarationMirror {
* For example, [:'bar':] is the constructor name for constructor
* [:Foo.bar:] of type [:Foo:].
*/
- String get constructorName;
+ Symbol get constructorName;
/**
* Is the reflectee a const constructor?
@@ -641,10 +641,8 @@ abstract class ParameterMirror implements VariableMirror {
/**
* A mirror on the default value for this parameter, if it exists.
- *
- * TODO(turnidge): String may not be a good representation of this
- * at runtime.
*/
+ // TODO(ahe): This should return an InstanceMirror.
String get defaultValue;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698