Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -138,23 +138,23 @@ |
else if (subscription == this._subscriptions) |
{ |
this._subscriptions = null; |
} |
} |
}, |
/** |
- * Serializes the filter to an array of strings for writing out on the disk. |
- * @param {string[]} buffer buffer to push the serialization results into |
+ * Generates serialized filter. |
+ * @yields {string} |
*/ |
- serialize(buffer) |
+ *serialize() |
{ |
- buffer.push("[Filter]"); |
- buffer.push("text=" + this.text); |
+ yield "[Filter]"; |
Manish Jethani
2018/10/09 15:11:03
Let's extract the value of the text property first
Jon Sonesen
2018/10/12 03:50:05
Done.
|
+ yield "text=" + this.text; |
}, |
toString() |
{ |
return this.text; |
} |
}; |
@@ -321,17 +321,17 @@ |
* @type {string} |
*/ |
reason: null, |
/** |
* See Filter.serialize() |
* @inheritdoc |
*/ |
- serialize(buffer) {} |
+ *serialize() {} |
}); |
/** |
* Class for comments |
* @param {string} text see {@link Filter Filter()} |
* @constructor |
* @augments Filter |
*/ |
@@ -343,17 +343,17 @@ |
CommentFilter.prototype = extend(Filter, { |
type: "comment", |
/** |
* See Filter.serialize() |
* @inheritdoc |
*/ |
- serialize(buffer) {} |
+ *serialize() {} |
}); |
/** |
* Abstract base class for filters that can get hits |
* @param {string} text |
* see {@link Filter Filter()} |
* @param {string} [domains] |
* Domains that the filter is restricted to separated by domainSeparator |
@@ -609,27 +609,27 @@ |
return !(sitekeys && sitekeys.length) && (!domains || domains.get("")); |
}, |
/** |
* See Filter.serialize() |
* @inheritdoc |
*/ |
- serialize(buffer) |
+ *serialize() |
{ |
if (this._disabled || this._hitCount || this._lastHit) |
Manish Jethani
2018/10/09 15:11:03
Similarly, let's extract the values here first:
Jon Sonesen
2018/10/12 03:50:05
Done.
|
{ |
- Filter.prototype.serialize.call(this, buffer); |
+ yield* Filter.prototype.serialize.call(this); |
if (this._disabled) |
- buffer.push("disabled=true"); |
+ yield "disabled=true"; |
if (this._hitCount) |
- buffer.push("hitCount=" + this._hitCount); |
+ yield "hitCount=" + this._hitCount; |
if (this._lastHit) |
- buffer.push("lastHit=" + this._lastHit); |
+ yield "lastHit=" + this._lastHit; |
} |
} |
}); |
/** |
* Abstract base class for RegExp-based filters |
* @param {string} text see {@link Filter Filter()} |
* @param {string} regexpSource |