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

Unified Diff: ui/file_manager/file_manager/common/js/util.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/common/js/util.js
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js
index e6dbe422996e213a57a3f01c3be9e7651aae13e3..02620223076f1a782f543a55f66ffab5ef3e889d 100644
--- a/ui/file_manager/file_manager/common/js/util.js
+++ b/ui/file_manager/file_manager/common/js/util.js
@@ -460,7 +460,7 @@ util.AppCache.cleanup_ = function(map) {
if (map.hasOwnProperty(key))
keys.push(key);
}
- keys.sort(function(a, b) { return map[a].expire > map[b].expire; });
+ keys.sort(function(a, b) { return map[a].expire - map[b].expire; });
var cutoff = Date.now();
@@ -495,7 +495,9 @@ util.loadImage = function(image, url, opt_options, opt_isValid) {
image,
opt_options || {},
function() {},
- function() { image.onerror(); },
+ function() {
+ image.onerror(new Event('load-error'));
+ },
opt_isValid);
};

Powered by Google App Engine
This is Rietveld 408576698