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

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

Issue 68103016: When ClassMirrors are created by enumerating members of a LibraryMirror, have the ClassMirror use t… (Closed) Base URL: https://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 | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/hierarchy_invariants_test.dart
diff --git a/tests/lib/mirrors/hierarchy_invariants_test.dart b/tests/lib/mirrors/hierarchy_invariants_test.dart
index 19d3152a0ac77d2c6e2ca1f3fe9cf8600e551742..20f5fec642afe27f47d36a44ecc3b806a8f592c3 100644
--- a/tests/lib/mirrors/hierarchy_invariants_test.dart
+++ b/tests/lib/mirrors/hierarchy_invariants_test.dart
@@ -12,9 +12,7 @@ isAnonymousMixinApplication(classMirror) {
return MirrorSystem.getName(classMirror.simpleName).contains(' with ');
}
-check(classMirror) {
- if (classMirror is TypedefMirror) return;
rmacnak 2013/11/13 21:41:32 Can't happen anymore since TypedefMirror is no lon
-
+checkClass(classMirror) {
Expect.isTrue(classMirror.simpleName is Symbol);
Expect.notEquals(null, classMirror.owner);
Expect.isTrue(classMirror.owner is LibraryMirror);
@@ -28,18 +26,14 @@ check(classMirror) {
if (classMirror.superclass == null) {
Expect.equals(reflectClass(Object), classMirror);
} else {
- check(classMirror.superclass);
+ checkClass(classMirror.superclass);
}
}
-main() {
- currentMirrorSystem().libraries.values.forEach((libraryMirror) {
- libraryMirror.classes.values.forEach((classMirror) {
- check(classMirror);
- });
- });
+checkLibrary(libraryMirror) {
+ libraryMirror.classes.values.forEach(checkClass);
+}
- Expect.throws(() => reflectClass(dynamic),
rmacnak 2013/11/13 21:41:32 Covered in another test.
- (e) => e is ArgumentError,
- 'dynamic is not a class');
+main() {
+ currentMirrorSystem().libraries.values.forEach(checkLibrary);
}
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698