Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 | 61 |
| 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 print(lm.simpleName); | |
|
vsm
2014/01/24 20:37:12
Did you mean to keep this in?
rmacnak
2014/01/24 21:04:08
No, removed.
| |
| 71 checkMap(lm.declarations, 'LibraryMirror.declarations'); | 72 checkMap(lm.declarations, 'LibraryMirror.declarations'); |
| 72 checkMap(lm.topLevelMembers, 'LibraryMirror.topLevelMembers'); | 73 checkMap(lm.topLevelMembers, 'LibraryMirror.topLevelMembers'); |
| 73 checkList(lm.metadata, 'LibraryMirror.metadata'); | 74 checkList(lm.metadata, 'LibraryMirror.metadata'); |
| 74 | 75 |
| 75 lm.declarations.values.forEach(checkDeclaration); | 76 lm.declarations.values.forEach(checkDeclaration); |
| 76 lm.topLevelMembers.values.forEach(checkDeclaration); | 77 lm.topLevelMembers.values.forEach(checkDeclaration); |
| 77 } | 78 } |
| 78 | 79 |
| 79 main() { | 80 main() { |
| 80 currentMirrorSystem().libraries.values.forEach(checkLibrary); | 81 currentMirrorSystem().libraries.values.forEach(checkLibrary); |
| 81 checkType(currentMirrorSystem().voidType); | 82 checkType(currentMirrorSystem().voidType); |
| 82 checkType(currentMirrorSystem().dynamicType); | 83 checkType(currentMirrorSystem().dynamicType); |
| 83 } | 84 } |
| OLD | NEW |