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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/directory_tree.js

Issue 657253004: Fix suspicious code detected by closure compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect review comments. Created 6 years, 2 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
Index: ui/file_manager/file_manager/foreground/js/ui/directory_tree.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js b/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js
index 1f01e9e4e59203e2aa76d73f43fd8a9f46839324..49b103525fe71ba3a821f930ec3c426eb0ed847a 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/directory_tree.js
@@ -524,7 +524,11 @@ VolumeItem.prototype.updateSubDirectories = function(recursive) {
entries.push(this.volumeInfo.fakeEntries[key]);
}
// This list is sorted by URL on purpose.
- entries.sort(function(a, b) { return a.toURL() < b.toURL(); });
+ entries.sort(function(a, b) {
+ if (a.toURL() === b.toURL())
+ return 0;
+ return b.toURL() > a.toURL() ? 1 : -1;
+ });
for (var i = 0; i < entries.length; i++) {
var item = new DirectoryItem(
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/share_client.js ('k') | ui/file_manager/file_manager/foreground/js/ui/file_grid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698