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

Unified Diff: sdk/lib/_internal/lib/mirrors_patch.dart

Issue 24005002: Make TypedefMirror a direct descendant of TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 2 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: sdk/lib/_internal/lib/mirrors_patch.dart
diff --git a/sdk/lib/_internal/lib/mirrors_patch.dart b/sdk/lib/_internal/lib/mirrors_patch.dart
index 47009848c8972607cc5cc8db586f282668da300d..271f54db7dd7df890cbd73d179fa68ca0a749c06 100644
--- a/sdk/lib/_internal/lib/mirrors_patch.dart
+++ b/sdk/lib/_internal/lib/mirrors_patch.dart
@@ -19,5 +19,11 @@ patch Future<MirrorSystem> mirrorSystemOf(SendPort port) {
patch InstanceMirror reflect(Object reflectee) => js.reflect(reflectee);
patch ClassMirror reflectClass(Type key) {
- return js.reflectType(key).originalDeclaration;
+ TypeMirror tm = reflectType(key);
+ if (tm is ClassMirror) {
+ return (tm as ClassMirror).originalDeclaration;
+ }
+ throw new ArgumentError("$key does not denote a class");
}
+
+patch TypeMirror reflectType(Type key) => js.reflectType(key);

Powered by Google App Engine
This is Rietveld 408576698