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

Unified Diff: tests/lib/mirrors/stringify.dart

Issue 921163004: Add LibraryDependencyMirror.isDeferred. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync + year fix Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/mirrors/library_imports_deferred_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/stringify.dart
diff --git a/tests/lib/mirrors/stringify.dart b/tests/lib/mirrors/stringify.dart
index 067769a1757f44a90e05cfde4b434f8aba34dfa6..51298e97bb2e9f0a6ae863054a01ce9100dffe80 100644
--- a/tests/lib/mirrors/stringify.dart
+++ b/tests/lib/mirrors/stringify.dart
@@ -116,8 +116,15 @@ stringifyMethod(MethodMirror method) {
stringifyDependencies(LibraryMirror l) {
n(s) => s is Symbol ? MirrorSystem.getName(s) : s;
- compareDep(a, b) =>
- n(a.targetLibrary.simpleName).compareTo(n(b.targetLibrary.simpleName));
+ compareDep(a, b) {
+ if (a.targetLibrary == b.targetLibrary) {
+ if ((a.prefix != null) && (b.prefix != null)) {
+ return n(a.prefix).compareTo(n(b.prefix));
+ }
+ return a.prefix == null ? 1 : -1;
+ }
+ return n(a.targetLibrary.simpleName).compareTo(n(b.targetLibrary.simpleName));
+ }
compareCom(a, b) => n(a.identifier).compareTo(n(b.identifier));
compareFirst(a, b) => a[0].compareTo(b[0]);
sortBy(c, p) => new List.from(c)..sort(p);
@@ -127,6 +134,7 @@ stringifyDependencies(LibraryMirror l) {
if (dep.isImport) buffer.write('import ');
if (dep.isExport) buffer.write('export ');
buffer.write(n(dep.targetLibrary.simpleName));
+ if (dep.isDeferred) buffer.write(' deferred');
if (dep.prefix != null) buffer.write(' as ${n(dep.prefix)}');
buffer.write('\n');
« no previous file with comments | « tests/lib/mirrors/library_imports_deferred_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698