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

Delta Between Two Patch Sets: lib/utils.js

Issue 6305806509146112: Issue 427 - Remove non-standard function and getter syntax (Closed)
Left Patch Set: Created May 5, 2014, 12:18 p.m.
Right Patch Set: Wow sorry for those wrong braces, I am so used to a different style that I didn't even realize what… Created May 18, 2014, 10:51 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/ui.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }, 48 },
49 49
50 /** 50 /**
51 * Returns whether we are running in Fennec, for Fennec-specific hacks 51 * Returns whether we are running in Fennec, for Fennec-specific hacks
52 * @type Boolean 52 * @type Boolean
53 */ 53 */
54 get isFennec() 54 get isFennec()
55 { 55 {
56 let {application} = require("info"); 56 let {application} = require("info");
57 let result = (application == "fennec" || application == "fennec2"); 57 let result = (application == "fennec" || application == "fennec2");
58 Utils.__defineGetter__("isFennec", function() { return result; }); 58 Utils.__defineGetter__("isFennec", () => result);
59 return result; 59 return result;
60 }, 60 },
61 61
62 /** 62 /**
63 * Returns the user interface locale selected for adblockplus chrome package. 63 * Returns the user interface locale selected for adblockplus chrome package.
64 */ 64 */
65 get appLocale() 65 get appLocale()
66 { 66 {
67 let locale = "en-US"; 67 let locale = "en-US";
68 try 68 try
69 { 69 {
70 locale = Utils.chromeRegistry.getSelectedLocale("adblockplus"); 70 locale = Utils.chromeRegistry.getSelectedLocale("adblockplus");
71 } 71 }
72 catch (e) 72 catch (e)
73 { 73 {
74 Cu.reportError(e); 74 Cu.reportError(e);
75 } 75 }
76 Utils.__defineGetter__("appLocale", function() { return locale; }); 76 Utils.__defineGetter__("appLocale", () => locale);
77 return Utils.appLocale; 77 return Utils.appLocale;
78 }, 78 },
79 79
80 /** 80 /**
81 * Returns version of the Gecko platform 81 * Returns version of the Gecko platform
82 */ 82 */
83 get platformVersion() 83 get platformVersion()
84 { 84 {
85 let platformVersion = Services.appinfo.platformVersion; 85 let platformVersion = Services.appinfo.platformVersion;
86 Utils.__defineGetter__("platformVersion", function() { return platformVersio n; }); 86 Utils.__defineGetter__("platformVersion", () => platformVersion);
87 return Utils.platformVersion; 87 return Utils.platformVersion;
88 }, 88 },
89 89
90 /** 90 /**
91 * Retrieves a string from global.properties string bundle, will throw if stri ng isn't found. 91 * Retrieves a string from global.properties string bundle, will throw if stri ng isn't found.
92 * 92 *
93 * @param {String} name string name 93 * @param {String} name string name
94 * @return {String} 94 * @return {String}
95 */ 95 */
96 getString: function(name) 96 getString: function(name)
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 Cu.reportError(e); 772 Cu.reportError(e);
773 // Expected, ctypes isn't supported in Gecko 1.9.2 773 // Expected, ctypes isn't supported in Gecko 1.9.2
774 return null; 774 return null;
775 } 775 }
776 }); 776 });
777 777
778 if ("@mozilla.org/messenger/headerparser;1" in Cc) 778 if ("@mozilla.org/messenger/headerparser;1" in Cc)
779 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser"); 779 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser");
780 else 780 else
781 Utils.headerParser = null; 781 Utils.headerParser = null;
LEFTRIGHT
« lib/ui.js ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld