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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 29375915: Issue 4878 - Start using ESLint for adblockpluscore (Closed)
Left Patch Set: Addressed Wladimir's comments Created March 8, 2017, 12:28 p.m.
Right Patch Set: Removed unused imports Created March 15, 2017, 3:11 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/events.js ('k') | lib/filterListener.js » ('j') | 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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 type: "invalid", 202 type: "invalid",
203 203
204 /** 204 /**
205 * Reason why this filter is invalid 205 * Reason why this filter is invalid
206 * @type {string} 206 * @type {string}
207 */ 207 */
208 reason: null, 208 reason: null,
209 209
210 /** 210 /**
211 * See Filter.serialize() 211 * See Filter.serialize()
212 * @inheritdoc
212 */ 213 */
213 serialize(buffer) {} 214 serialize(buffer) {}
214 }); 215 });
215 216
216 /** 217 /**
217 * Class for comments 218 * Class for comments
218 * @param {string} text see Filter() 219 * @param {string} text see Filter()
219 * @constructor 220 * @constructor
220 * @augments Filter 221 * @augments Filter
221 */ 222 */
222 function CommentFilter(text) 223 function CommentFilter(text)
223 { 224 {
224 Filter.call(this, text); 225 Filter.call(this, text);
225 } 226 }
226 exports.CommentFilter = CommentFilter; 227 exports.CommentFilter = CommentFilter;
227 228
228 CommentFilter.prototype = extend(Filter, { 229 CommentFilter.prototype = extend(Filter, {
229 type: "comment", 230 type: "comment",
230 231
231 /** 232 /**
232 * See Filter.serialize() 233 * See Filter.serialize()
234 * @inheritdoc
233 */ 235 */
234 serialize(buffer) {} 236 serialize(buffer) {}
235 }); 237 });
236 238
237 /** 239 /**
238 * Abstract base class for filters that can get hits 240 * Abstract base class for filters that can get hits
239 * @param {string} text 241 * @param {string} text
240 * see Filter() 242 * see Filter()
241 * @param {string} [domains] 243 * @param {string} [domains]
242 * Domains that the filter is restricted to separated by domainSeparator 244 * Domains that the filter is restricted to separated by domainSeparator
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 * @return {boolean} 499 * @return {boolean}
498 */ 500 */
499 isGeneric() 501 isGeneric()
500 { 502 {
501 return !(this.sitekeys && this.sitekeys.length) && 503 return !(this.sitekeys && this.sitekeys.length) &&
502 (!this.domains || this.domains[""]); 504 (!this.domains || this.domains[""]);
503 }, 505 },
504 506
505 /** 507 /**
506 * See Filter.serialize() 508 * See Filter.serialize()
509 * @inheritdoc
507 */ 510 */
508 serialize(buffer) 511 serialize(buffer)
509 { 512 {
510 if (this._disabled || this._hitCount || this._lastHit) 513 if (this._disabled || this._hitCount || this._lastHit)
511 { 514 {
512 Filter.prototype.serialize.call(this, buffer); 515 Filter.prototype.serialize.call(this, buffer);
513 if (this._disabled) 516 if (this._disabled)
514 buffer.push("disabled=true"); 517 buffer.push("disabled=true");
515 if (this._hitCount) 518 if (this._hitCount)
516 buffer.push("hitCount=" + this._hitCount); 519 buffer.push("hitCount=" + this._hitCount);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 */ 1046 */
1044 function ElemHideEmulationFilter(text, domains, selector) 1047 function ElemHideEmulationFilter(text, domains, selector)
1045 { 1048 {
1046 ElemHideBase.call(this, text, domains, selector); 1049 ElemHideBase.call(this, text, domains, selector);
1047 } 1050 }
1048 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; 1051 exports.ElemHideEmulationFilter = ElemHideEmulationFilter;
1049 1052
1050 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { 1053 ElemHideEmulationFilter.prototype = extend(ElemHideBase, {
1051 type: "elemhideemulation" 1054 type: "elemhideemulation"
1052 }); 1055 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld