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

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: merge with generic interfaces and mixins 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
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | sdk/lib/mirrors/mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dba0e33d7376ec138d86af3709c4f08766976ccb..12547912ec604d13a164823797bedb1b24ed4ba2 100644
--- a/sdk/lib/_internal/lib/mirrors_patch.dart
+++ b/sdk/lib/_internal/lib/mirrors_patch.dart
@@ -24,7 +24,13 @@ patch InstanceMirror reflect(Object reflectee) => js.reflect(reflectee);
patch ClassMirror reflectClass(Type key) {
if (key is! Type || key == dynamic) {
- throw new ArgumentError('$key does not denote a class');
+ throw new ArgumentError('$key does not denote a class');
}
- return js.reflectType(key).originalDeclaration;
+ TypeMirror tm = reflectType(key);
+ if (tm is! ClassMirror) {
+ throw new ArgumentError("$key does not denote a class");
+ }
+ return (tm as ClassMirror).originalDeclaration;
}
+
+patch TypeMirror reflectType(Type key) => js.reflectType(key);
« no previous file with comments | « sdk/lib/_internal/lib/js_mirrors.dart ('k') | sdk/lib/mirrors/mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698