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

Unified Diff: ext/background.js

Issue 29371763: Issue 4795 - Use modern JavaScript syntax (Closed)
Patch Set: "use strict"; Created Jan. 16, 2017, 3:30 a.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
« no previous file with comments | « composer.postload.js ('k') | ext/common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/background.js
diff --git a/ext/background.js b/ext/background.js
index f6ce8ce075bae22f0569a1cdd741ee29646ba580..cfe28fe50f8c78cebfa0f450453c58e467380461 100644
--- a/ext/background.js
+++ b/ext/background.js
@@ -15,12 +15,13 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-(function()
+"use strict";
+
{
- var nonEmptyPageMaps = Object.create(null);
- var pageMapCounter = 0;
+ let nonEmptyPageMaps = Object.create(null);
+ let pageMapCounter = 0;
- var PageMap = ext.PageMap = function()
+ let PageMap = ext.PageMap = function()
{
this._map = Object.create(null);
this._id = ++pageMapCounter;
@@ -52,7 +53,7 @@
},
clear: function()
{
- for (var id in this._map)
+ for (let id in this._map)
this._delete(id);
},
delete: function(page)
@@ -61,9 +62,9 @@
}
};
- ext._removeFromAllPageMaps = function(pageId)
+ ext._removeFromAllPageMaps = pageId =>
{
- for (var pageMapId in nonEmptyPageMaps)
+ for (let pageMapId in nonEmptyPageMaps)
nonEmptyPageMaps[pageMapId]._delete(pageId);
};
-})();
+}
« no previous file with comments | « composer.postload.js ('k') | ext/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld