OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.immutable_collections; | 5 library test.immutable_collections; |
6 | 6 |
7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 | 9 |
10 someException(e) => e is Exception || e is Error; | 10 someException(e) => e is Exception || e is Error; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 checkDeclaration(DeclarationMirror dm) { | 62 checkDeclaration(DeclarationMirror dm) { |
63 if (dm is MethodMirror) checkMethod(dm); | 63 if (dm is MethodMirror) checkMethod(dm); |
64 if (dm is ClassMirror) checkClass(dm); | 64 if (dm is ClassMirror) checkClass(dm); |
65 if (dm is TypeMirror) checkType(dm); | 65 if (dm is TypeMirror) checkType(dm); |
66 if (dm is VariableMirror) checkVariable(dm); | 66 if (dm is VariableMirror) checkVariable(dm); |
67 if (dm is TypeVariableMirror) checkTypeVariable(dm); | 67 if (dm is TypeVariableMirror) checkTypeVariable(dm); |
68 } | 68 } |
69 | 69 |
70 checkLibrary(LibraryMirror lm) { | 70 checkLibrary(LibraryMirror lm) { |
71 checkMap(lm.declarations, 'LibraryMirror.declarations'); | 71 checkMap(lm.declarations, 'LibraryMirror.declarations'); |
72 checkMap(lm.topLevelMembers, 'LibraryMirror.topLevelMembers'); | |
73 checkList(lm.metadata, 'LibraryMirror.metadata'); | 72 checkList(lm.metadata, 'LibraryMirror.metadata'); |
74 | 73 |
75 lm.declarations.values.forEach(checkDeclaration); | 74 lm.declarations.values.forEach(checkDeclaration); |
76 lm.topLevelMembers.values.forEach(checkDeclaration); | |
77 } | 75 } |
78 | 76 |
79 main() { | 77 main() { |
80 currentMirrorSystem().libraries.values.forEach(checkLibrary); | 78 currentMirrorSystem().libraries.values.forEach(checkLibrary); |
81 checkType(currentMirrorSystem().voidType); | 79 checkType(currentMirrorSystem().voidType); |
82 checkType(currentMirrorSystem().dynamicType); | 80 checkType(currentMirrorSystem().dynamicType); |
83 } | 81 } |
OLD | NEW |