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

Side by Side Diff: chrome/content/ui/filters-subscriptionactions.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 | « no previous file | chrome/content/ui/progressBar.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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 get _accelMask() 229 get _accelMask()
230 { 230 {
231 let result = this._ctrlMask; 231 let result = this._ctrlMask;
232 try { 232 try {
233 let accelKey = Utils.prefService.getIntPref("ui.key.accelKey"); 233 let accelKey = Utils.prefService.getIntPref("ui.key.accelKey");
234 if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_META) 234 if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_META)
235 result = this._metaMask; 235 result = this._metaMask;
236 else if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_ALT) 236 else if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_ALT)
237 result = this._altMask; 237 result = this._altMask;
238 } catch(e) {} 238 } catch(e) {}
239 this.__defineGetter__("_accelMask", function() result); 239 Object.defineProperty(this, "_accelMask", {value: result});
240 return result; 240 return result;
241 }, 241 },
242 242
243 /** 243 /**
244 * Called when a key is pressed on the subscription list. 244 * Called when a key is pressed on the subscription list.
245 */ 245 */
246 keyPress: function(/**Event*/ event) 246 keyPress: function(/**Event*/ event)
247 { 247 {
248 let modifiers = 0; 248 let modifiers = 0;
249 if (event.altKey) 249 if (event.altKey)
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 return; 597 return;
598 598
599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN TER) 599 if (event.keyCode == event.DOM_VK_RETURN || event.keyCode == event.DOM_VK_EN TER)
600 { 600 {
601 // This shouldn't accept our dialog, only the panel 601 // This shouldn't accept our dialog, only the panel
602 event.preventDefault(); 602 event.preventDefault();
603 E("selectSubscriptionAccept").doCommand(); 603 E("selectSubscriptionAccept").doCommand();
604 } 604 }
605 } 605 }
606 }; 606 };
OLDNEW
« no previous file with comments | « no previous file | chrome/content/ui/progressBar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld