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

Unified Diff: dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart

Issue 14173005: Update dart:mirrors to use Symbol. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also use _symbol_dev.Symbol.getName in dart2js 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
Index: dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart
diff --git a/dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart b/dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart
index e197b0be8957bbcebd483e35bf7778f5c589ee9e..90455c00ecf2e7309c4c4a1f20a9ac72b936c7a0 100755
--- a/dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart
+++ b/dart/sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart
@@ -54,7 +54,8 @@ void _serializeObject(String name, Object o, JsonPrinter printer) {
// TODO(jacobr): this code works only because futures for mirrors return
// immediately.
for(String memberName in members) {
- var result = deprecatedFutureValue(mirror.getFieldAsync(memberName));
+ var result =
+ deprecatedFutureValue(mirror.getFieldAsync(new Symbol(memberName)));
_serialize(memberName, result.reflectee, printer);
}
printer.endObject();
@@ -62,19 +63,25 @@ void _serializeObject(String name, Object o, JsonPrinter printer) {
void determineAllMembers(ClassMirror classMirror,
List<String> members) {
- for(String getterName in classMirror.getters.keys) {
- if (!members.contains(getterName)) {
- members.add(getterName);
+ for(Symbol getterName in classMirror.getters.keys) {
+ if (!members.contains(MirrorSystem.getName(getterName))) {
+ members.add(MirrorSystem.getName(getterName));
}
}
- for(String fieldName in classMirror.variables.keys) {
- if (!members.contains(fieldName)) {
- members.add(fieldName);
+ for(Symbol fieldName in classMirror.variables.keys) {
+ if (!members.contains(MirrorSystem.getName(fieldName))) {
+ members.add(MirrorSystem.getName(fieldName));
}
}
if (classMirror.superclass != null &&
+
+ // TODO(ahe): What is this test for? Consider removing it,
+ // dart2js will issue an error if there is a cycle in superclass
+ // hierarchy.
classMirror.superclass.qualifiedName != classMirror.qualifiedName &&
- classMirror.superclass.qualifiedName != 'dart.core.Object') {
+
+ MirrorSystem.getName(classMirror.superclass.qualifiedName) !=
+ 'dart.core.Object') {
determineAllMembers(classMirror.superclass, members);
}
}
« no previous file with comments | « dart/sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart ('k') | dart/sdk/lib/_internal/libraries.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698