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

Unified Diff: pkg/serialization/lib/src/serialization_rule.dart

Issue 63563003: - Reverting mirror changes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « pkg/observe/lib/src/observable.dart ('k') | pkg/unittest/lib/mirror_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/src/serialization_rule.dart
===================================================================
--- pkg/serialization/lib/src/serialization_rule.dart (revision 30026)
+++ pkg/serialization/lib/src/serialization_rule.dart (working copy)
@@ -410,13 +410,18 @@
if (name.contains(":")) {
var uri = Uri.parse(name);
var libMirror = currentMirrorSystem().libraries[uri];
- return libMirror.classes[new Symbol(type)];
+ var result = libMirror.declarations[new Symbol(type)];
+ return result is ClassMirror ? result : null;
} else {
var symbol = new Symbol(name);
var typeSymbol = new Symbol(type);
- var libMirror = currentMirrorSystem().libraries.values.firstWhere(
- (lib) => lib.simpleName == symbol && lib.classes[typeSymbol] != null);
- return libMirror.classes[typeSymbol];
+ var libMirror = currentMirrorSystem().libraries.values.firstWhere((lib) {
+ if (lib.simpleName != symbol) return false;
+ var candidate = lib.declarations[typeSymbol];
+ return candidate != null && candidate is ClassMirror;
+ });
+ var result = libMirror.declarations[typeSymbol];
+ return result is ClassMirror ? result : null;
}
}
}
« no previous file with comments | « pkg/observe/lib/src/observable.dart ('k') | pkg/unittest/lib/mirror_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698