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

Unified Diff: tests/lib/mirrors/intercepted_object_test.dart

Issue 236313012: Don't hide interceptors in mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 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
« no previous file with comments | « tests/lib/mirrors/intercepted_class_test.dart ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/intercepted_object_test.dart
diff --git a/tests/lib/mirrors/intercepted_object_test.dart b/tests/lib/mirrors/intercepted_object_test.dart
index fc6fe7b24914002bad265db0be03e3cbbc421f58..1aa806085429e895e2b612122bf4aad288f34a40 100644
--- a/tests/lib/mirrors/intercepted_object_test.dart
+++ b/tests/lib/mirrors/intercepted_object_test.dart
@@ -10,17 +10,31 @@ import 'dart:mirrors';
import 'stringify.dart' show stringify, expect;
-import 'intercepted_class_test.dart' show checkClassMirror;
+import 'intercepted_class_test.dart' show checkClassMirrorMethods;
-checkObject(object, String name) {
- checkClassMirror(reflect(object).type, name);
+checkImplements(object, String name) {
+ ClassMirror cls = reflect(object).type;
+ checkClassMirrorMethods(cls);
+
+ List<ClassMirror> superinterfaces = cls.superinterfaces;
+ String symName = 's($name)';
+ for (ClassMirror superinterface in superinterfaces) {
+ print(superinterface.simpleName);
+ if (symName == stringify(superinterface.simpleName)) {
+ checkClassMirrorMethods(superinterface);
+ return;
+ }
+ }
+
+ // TODO(floitsch): use correct fail
+ expect(name, "super interface not found");
}
main() {
- checkObject('', 'String');
- checkObject(1, 'int');
- checkObject(1.5, 'double');
- checkObject(true, 'bool');
- checkObject(false, 'bool');
- checkObject([], 'List');
+ checkImplements('', 'String');
+ checkImplements(1, 'int');
+ checkImplements(1.5, 'double');
+ checkImplements(true, 'bool');
+ checkImplements(false, 'bool');
+ checkImplements([], 'List');
}
« no previous file with comments | « tests/lib/mirrors/intercepted_class_test.dart ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698