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

Side by Side Diff: chrome/content/ui/sidebar.js

Issue 5055554716172288: Issue 653 -Object.defineProperty instead of defineGetter / defineSetter (Closed)
Patch Set: I am generally not a big fan of iterating over property names. It seems like for most objects here … Created June 26, 2014, 8:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/ui/progressBar.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 if (params && params.position) 78 if (params && params.position)
79 defaults = params.position; 79 defaults = params.position;
80 80
81 let wnd = parent.document.documentElement; 81 let wnd = parent.document.documentElement;
82 for (let attr in defaults) 82 for (let attr in defaults)
83 if (!wnd.hasAttribute(attr)) 83 if (!wnd.hasAttribute(attr))
84 wnd.setAttribute(attr, defaults[attr]); 84 wnd.setAttribute(attr, defaults[attr]);
85 } 85 }
86 86
87 let {getBrowser, addBrowserLocationListener} = require("appSupport"); 87 let {getBrowser, addBrowserLocationListener} = require("appSupport");
88 window.__defineGetter__("content", function() {return getBrowser(mainWin).cont entWindow;}); 88 Object.defineProperty(window, "content", { get: () => getBrowser(mainWin).cont entWindow });
89 89
90 // Initialize matcher for disabled filters 90 // Initialize matcher for disabled filters
91 reloadDisabledFilters(); 91 reloadDisabledFilters();
92 FilterNotifier.addListener(reloadDisabledFilters); 92 FilterNotifier.addListener(reloadDisabledFilters);
93 Prefs.addListener(onPrefChange); 93 Prefs.addListener(onPrefChange);
94 94
95 // Activate flasher 95 // Activate flasher
96 list.addEventListener("select", onSelectionChange, false); 96 list.addEventListener("select", onSelectionChange, false);
97 97
98 // Initialize data 98 // Initialize data
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 return {tooltip: this.itemsDummyTooltip}; 1237 return {tooltip: this.itemsDummyTooltip};
1238 }, 1238 },
1239 1239
1240 invalidateItem: function(item) 1240 invalidateItem: function(item)
1241 { 1241 {
1242 let row = this.data.indexOf(item); 1242 let row = this.data.indexOf(item);
1243 if (row >= 0) 1243 if (row >= 0)
1244 this.boxObject.invalidateRow(row); 1244 this.boxObject.invalidateRow(row);
1245 } 1245 }
1246 } 1246 }
OLDNEW
« no previous file with comments | « chrome/content/ui/progressBar.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld