| OLD | NEW |
| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 let buffer = []; | 147 let buffer = []; |
| 148 this.serialize(buffer); | 148 this.serialize(buffer); |
| 149 return buffer.join("\n"); | 149 return buffer.join("\n"); |
| 150 } | 150 } |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * Cache for known filter subscriptions, maps URL to subscription objects. | 154 * Cache for known filter subscriptions, maps URL to subscription objects. |
| 155 * @type Object | 155 * @type Object |
| 156 */ | 156 */ |
| 157 Subscription.knownSubscriptions = {__proto__: null}; | 157 Subscription.knownSubscriptions = Object.create(null); |
| 158 | 158 |
| 159 /** | 159 /** |
| 160 * Returns a subscription from its URL, creates a new one if necessary. | 160 * Returns a subscription from its URL, creates a new one if necessary. |
| 161 * @param {String} url URL of the subscription | 161 * @param {String} url URL of the subscription |
| 162 * @return {Subscription} subscription or null if the subscription couldn't be c
reated | 162 * @return {Subscription} subscription or null if the subscription couldn't be c
reated |
| 163 */ | 163 */ |
| 164 Subscription.fromURL = function(url) | 164 Subscription.fromURL = function(url) |
| 165 { | 165 { |
| 166 if (url in Subscription.knownSubscriptions) | 166 if (url in Subscription.knownSubscriptions) |
| 167 return Subscription.knownSubscriptions[url]; | 167 return Subscription.knownSubscriptions[url]; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 if (this.softExpiration) | 578 if (this.softExpiration) |
| 579 buffer.push("softExpiration=" + this.softExpiration); | 579 buffer.push("softExpiration=" + this.softExpiration); |
| 580 if (this.errors) | 580 if (this.errors) |
| 581 buffer.push("errors=" + this.errors); | 581 buffer.push("errors=" + this.errors); |
| 582 if (this.version) | 582 if (this.version) |
| 583 buffer.push("version=" + this.version); | 583 buffer.push("version=" + this.version); |
| 584 if (this.requiredVersion) | 584 if (this.requiredVersion) |
| 585 buffer.push("requiredVersion=" + this.requiredVersion); | 585 buffer.push("requiredVersion=" + this.requiredVersion); |
| 586 } | 586 } |
| 587 }; | 587 }; |
| OLD | NEW |