Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/stats.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: Undo accidental whitespace change Created Jan. 16, 2017, 2:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/stats.js
diff --git a/lib/stats.js b/lib/stats.js
index 81dfff3af0728c3ef5941002c01f055752cdccc3..a8ab3f1d87c6a240c7816a381dc3873661e9c904 100644
--- a/lib/stats.js
+++ b/lib/stats.js
@@ -17,6 +17,8 @@
/** @module stats */
+"use strict";
+
let {Prefs} = require("prefs");
let {BlockingFilter} = require("filterClasses");
let {FilterNotifier} = require("filterNotifier");
@@ -30,10 +32,7 @@ let blockedPerPage = new ext.PageMap();
* @param {Page} page
* @return {Number}
*/
-exports.getBlockedPerPage = function(page)
-{
- return blockedPerPage.get(page) || 0;
-};
+exports.getBlockedPerPage = page => blockedPerPage.get(page) || 0;
FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, page) =>
{
@@ -57,11 +56,10 @@ FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, page) =>
Prefs.on("show_statsinicon", () =>
{
- ext.pages.query({}, function(pages)
+ ext.pages.query({}, pages =>
{
- for (var i = 0; i < pages.length; i++)
+ for (let page of pages)
{
- let page = pages[i];
let badge = null;
if (Prefs.show_statsinicon)

Powered by Google App Engine
This is Rietveld