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

Side by Side Diff: lib/filterStorage.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 | « lib/filterClasses.js ('k') | lib/io.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 { 78 {
79 file = IO.resolveFilePath(Services.prefs.getDefaultBranch("extensions.ad blockplus.").getCharPref("data_directory")); 79 file = IO.resolveFilePath(Services.prefs.getDefaultBranch("extensions.ad blockplus.").getCharPref("data_directory"));
80 if (file) 80 if (file)
81 file.append("patterns.ini"); 81 file.append("patterns.ini");
82 } catch(e) {} 82 } catch(e) {}
83 } 83 }
84 84
85 if (!file) 85 if (!file)
86 Cu.reportError("Adblock Plus: Failed to resolve filter file location from extensions.adblockplus.patternsfile preference"); 86 Cu.reportError("Adblock Plus: Failed to resolve filter file location from extensions.adblockplus.patternsfile preference");
87 87
88 this.__defineGetter__("sourceFile", () => file); 88 Object.defineProperty(this, "sourceFile", {value: file});
89 return this.sourceFile; 89 return file;
90 }, 90 },
91 91
92 /** 92 /**
93 * Will be set to true if no patterns.ini file exists. 93 * Will be set to true if no patterns.ini file exists.
94 * @type Boolean 94 * @type Boolean
95 */ 95 */
96 firstRun: false, 96 firstRun: false,
97 97
98 /** 98 /**
99 * Map of properties listed in the filter storage file before the sections 99 * Map of properties listed in the filter storage file before the sections
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 Subscription.knownSubscriptions = origKnownSubscriptions; 888 Subscription.knownSubscriptions = origKnownSubscriptions;
889 } 889 }
890 890
891 // Allow events to be processed every now and then. 891 // Allow events to be processed every now and then.
892 // Note: IO.readFromFile() will deal with the potential reentrance here. 892 // Note: IO.readFromFile() will deal with the potential reentrance here.
893 this.linesProcessed++; 893 this.linesProcessed++;
894 if (this.linesProcessed % 1000 == 0) 894 if (this.linesProcessed % 1000 == 0)
895 Utils.yield(); 895 Utils.yield();
896 } 896 }
897 }; 897 };
OLDNEW
« no previous file with comments | « lib/filterClasses.js ('k') | lib/io.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld