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

Side by Side Diff: dart/tests/compiler/dart2js_extra/mirror_printer_test.dart

Issue 23447008: Fix type error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months 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
« no previous file with comments | « no previous file | 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 /// Prints all information about all mirrors. This tests that it is possible to 5 /// Prints all information about all mirrors. This tests that it is possible to
6 /// enumerate all reflective information without crashing. 6 /// enumerate all reflective information without crashing.
7 7
8 // Note: Adding imports below is fine for regression tests. For example, 8 // Note: Adding imports below is fine for regression tests. For example,
9 // 'crash_library_metadata.dart' is imported to ensure the compiler doesn't 9 // 'crash_library_metadata.dart' is imported to ensure the compiler doesn't
10 // crash. 10 // crash.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (first) { 67 if (first) {
68 first = false; 68 first = false;
69 } else { 69 } else {
70 buffer.write(', '); 70 buffer.write(', ');
71 } 71 }
72 buffer 72 buffer
73 ..write(n(name)) 73 ..write(n(name))
74 ..write(': ') 74 ..write(': ')
75 ..write(stringifyInstance(mirror.getField(name))); 75 ..write(stringifyInstance(mirror.getField(name)));
76 }); 76 });
77 return buffer 77 buffer.write(')');
78 ..write(')') 78 return buffer.toString();
79 ..toString();
80 } 79 }
81 80
82 String stringifyMetadata(InstanceMirror mirror) { 81 String stringifyMetadata(InstanceMirror mirror) {
83 return '@${stringifyInstance(mirror)}'; 82 return '@${stringifyInstance(mirror)}';
84 } 83 }
85 84
86 bool writeType(TypeMirror mirror) { 85 bool writeType(TypeMirror mirror) {
87 if (mirror == null || mirror == dynamicType) return false; 86 if (mirror == null || mirror == dynamicType) return false;
88 w('${n(mirror.simpleName)} '); 87 w('${n(mirror.simpleName)} ');
89 return true; 88 return true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return buffer; 175 return buffer;
177 } 176 }
178 } 177 }
179 178
180 main() { 179 main() {
181 print(MirrorPrinter.stringify(currentMirrorSystem().libraries)); 180 print(MirrorPrinter.stringify(currentMirrorSystem().libraries));
182 // Clear the nodes to avoid confusing the fine test framework (by "fine" I 181 // Clear the nodes to avoid confusing the fine test framework (by "fine" I
183 // mean something else) -- ahe. 182 // mean something else) -- ahe.
184 document.body.nodes.clear(); 183 document.body.nodes.clear();
185 } 184 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698