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

Side by Side Diff: tests/lib/mirrors/immutable_collections_test.dart

Issue 34533003: VM: Always return immutable collections from the mirrors. (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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 checkList(cm.typeVariables, 'ClassMirror.typeVariables'); 53 checkList(cm.typeVariables, 'ClassMirror.typeVariables');
54 54
55 cm.methods.values.forEach(checkMethod); 55 cm.methods.values.forEach(checkMethod);
56 cm.getters.values.forEach(checkMethod); 56 cm.getters.values.forEach(checkMethod);
57 cm.setters.values.forEach(checkMethod); 57 cm.setters.values.forEach(checkMethod);
58 cm.constructors.values.forEach(checkMethod); 58 cm.constructors.values.forEach(checkMethod);
59 cm.variables.values.forEach(checkVariable); 59 cm.variables.values.forEach(checkVariable);
60 cm.typeVariables.forEach(checkTypeVariable); 60 cm.typeVariables.forEach(checkTypeVariable);
61 } 61 }
62 62
63 checkType(TypeMirror tm) {
64 checkList(tm.metadata, 'TypeMirror.metadata');
65 }
66
63 checkLibrary(LibraryMirror lm) { 67 checkLibrary(LibraryMirror lm) {
64 checkMap(lm.members, 'LibraryMirror.members'); 68 checkMap(lm.members, 'LibraryMirror.members');
65 checkMap(lm.variables, 'LibraryMirror.variables'); 69 checkMap(lm.variables, 'LibraryMirror.variables');
66 checkMap(lm.classes, 'LibraryMirror.classes'); 70 checkMap(lm.classes, 'LibraryMirror.classes');
67 // TODO(rmacnak): Revisit after members hoisted to TypeMirror. 71 checkMap(lm.types, 'LibraryMirror.types');
68 // checkMap(lm.types, 'LibraryMirror.types');
69 checkMap(lm.functions, 'LibraryMirror.functions'); 72 checkMap(lm.functions, 'LibraryMirror.functions');
70 checkMap(lm.getters, 'LibraryMirror.getters'); 73 checkMap(lm.getters, 'LibraryMirror.getters');
71 checkMap(lm.setters, 'LibraryMirror.setters'); 74 checkMap(lm.setters, 'LibraryMirror.setters');
72 checkList(lm.metadata, 'LibraryMirror.metadata'); 75 checkList(lm.metadata, 'LibraryMirror.metadata');
73 76
74 // lm.types.forEach(checkType); 77 lm.types.values.forEach(checkType);
75 lm.classes.values.forEach(checkClass); 78 lm.classes.values.forEach(checkClass);
76 lm.functions.values.forEach(checkMethod); 79 lm.functions.values.forEach(checkMethod);
77 lm.getters.values.forEach(checkMethod); 80 lm.getters.values.forEach(checkMethod);
78 lm.setters.values.forEach(checkMethod); 81 lm.setters.values.forEach(checkMethod);
79 lm.variables.values.forEach(checkVariable); 82 lm.variables.values.forEach(checkVariable);
80 } 83 }
81 84
82 main() { 85 main() {
83 currentMirrorSystem().libraries.values.forEach(checkLibrary); 86 currentMirrorSystem().libraries.values.forEach(checkLibrary);
84 // checkType(currentMirrorSystem().voidType); 87 checkType(currentMirrorSystem().voidType);
85 // checkType(currentMirrorSystem().dynamicType); 88 checkType(currentMirrorSystem().dynamicType);
86 } 89 }
OLDNEW
« runtime/vm/object.cc ('K') | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698