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

Unified Diff: tests/compiler/dart2js_extra/mirror_printer_test.dart

Issue 105453004: Remove use of deprecated mirror API from code that only runs against dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « pkg/polymer/lib/src/reflected_type.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_extra/mirror_printer_test.dart
diff --git a/tests/compiler/dart2js_extra/mirror_printer_test.dart b/tests/compiler/dart2js_extra/mirror_printer_test.dart
index 63c1d12b990e42639f243fe0aefa37056894e2f1..72e48784e0d8efd0f77c5e0486e01548da42fdb4 100644
--- a/tests/compiler/dart2js_extra/mirror_printer_test.dart
+++ b/tests/compiler/dart2js_extra/mirror_printer_test.dart
@@ -56,12 +56,14 @@ class MirrorPrinter {
return '$reflectee';
}
StringBuffer buffer = new StringBuffer();
- Map<Symbol, VariableMirror> variables = mirror.type.variables;
+ Map<Symbol, DeclarationMirror> declarations = mirror.type.declarations;
buffer
..write(n(mirror.type.simpleName))
..write('(');
bool first = true;
- variables.forEach((Symbol name, VariableMirror variable) {
+ declarations.forEach((Symbol name, DeclarationMirror declaration) {
+ if (declaration is! VariableMirror) return;
+ VariableMirror variable = declaration;
if (variable.isStatic) return;
// TODO(ahe): Include superclasses.
if (first) {
@@ -130,7 +132,7 @@ class MirrorPrinter {
w(' {');
bool first = true;
indented(() {
- for (DeclarationMirror declaration in mirror.members.values) {
+ for (DeclarationMirror declaration in mirror.declarations.values) {
if (first) {
first = false;
} else {
@@ -165,7 +167,9 @@ class MirrorPrinter {
writeLibrary(LibraryMirror library) {
w('library ${n(library.simpleName)};\n\n');
- library.members.values.forEach(writeDeclaration);
+ library.declarations.values
+ .where((d)=> d is! TypeMirror)
+ .forEach(writeDeclaration);
w('\n');
}
« no previous file with comments | « pkg/polymer/lib/src/reflected_type.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698