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: Created Jan. 13, 2017, 12:11 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: ext/background.js
diff --git a/ext/background.js b/ext/background.js
index f6ce8ce075bae22f0569a1cdd741ee29646ba580..af5cb8e8a25553951bfae7369c107d3721fabfac 100644
--- a/ext/background.js
+++ b/ext/background.js
@@ -15,12 +15,11 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
-(function()
{
- 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 +51,7 @@
},
clear: function()
{
- for (var id in this._map)
+ for (let id in this._map)
this._delete(id);
},
delete: function(page)
@@ -61,9 +60,9 @@
}
};
- ext._removeFromAllPageMaps = function(pageId)
+ ext._removeFromAllPageMaps = pageId =>
{
- for (var pageMapId in nonEmptyPageMaps)
+ for (let pageMapId in nonEmptyPageMaps)
nonEmptyPageMaps[pageMapId]._delete(pageId);
};
-})();
+}
« chrome/ext/common.js ('K') | « composer.postload.js ('k') | ext/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld