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

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

Issue 24984003: Make reflectClass in dart2js behave appropriately when passed bad arguments (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
« no previous file with comments | « no previous file | tests/lib/mirrors/reflect_class_test.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 47009848c8972607cc5cc8db586f282668da300d..ad0540948519a15d4462f1e6771f60d4528c8a6e 100644
--- a/sdk/lib/_internal/lib/mirrors_patch.dart
+++ b/sdk/lib/_internal/lib/mirrors_patch.dart
@@ -19,5 +19,8 @@ patch Future<MirrorSystem> mirrorSystemOf(SendPort port) {
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');
+ }
return js.reflectType(key).originalDeclaration;
}
« no previous file with comments | « no previous file | tests/lib/mirrors/reflect_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698