Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -234,49 +234,55 @@ ActiveFilter.prototype = |
_disabled: false, |
_hitCount: 0, |
_lastHit: 0, |
/** |
* Defines whether the filter is disabled |
* @type Boolean |
*/ |
- get disabled() this._disabled, |
+ get disabled() { |
Wladimir Palant
2014/05/15 07:12:38
Nit: Bracket on the next line please, same for the
|
+ return this._disabled; |
+ }, |
set disabled(value) |
{ |
if (value != this._disabled) |
{ |
let oldValue = this._disabled; |
this._disabled = value; |
FilterNotifier.triggerListeners("filter.disabled", this, value, oldValue); |
} |
return this._disabled; |
}, |
/** |
* Number of hits on the filter since the last reset |
* @type Number |
*/ |
- get hitCount() this._hitCount, |
+ get hitCount() { |
+ return this._hitCount; |
+ }, |
set hitCount(value) |
{ |
if (value != this._hitCount) |
{ |
let oldValue = this._hitCount; |
this._hitCount = value; |
FilterNotifier.triggerListeners("filter.hitCount", this, value, oldValue); |
} |
return this._hitCount; |
}, |
/** |
* Last time the filter had a hit (in milliseconds since the beginning of the epoch) |
* @type Number |
*/ |
- get lastHit() this._lastHit, |
+ get lastHit() { |
+ return this._lastHit; |
+ }, |
set lastHit(value) |
{ |
if (value != this._lastHit) |
{ |
let oldValue = this._lastHit; |
this._lastHit = value; |
FilterNotifier.triggerListeners("filter.lastHit", this, value, oldValue); |
} |
@@ -459,17 +465,17 @@ function RegExpFilter(text, regexpSource |
this.matchCase = matchCase; |
if (thirdParty != null) |
this.thirdParty = thirdParty; |
if (regexpSource.length >= 2 && regexpSource[0] == "/" && regexpSource[regexpSource.length - 1] == "/") |
{ |
// The filter is a regular expression - convert it immediately to catch syntax errors |
let regexp = new RegExp(regexpSource.substr(1, regexpSource.length - 2), this.matchCase ? "" : "i"); |
- this.__defineGetter__("regexp", function() regexp); |
+ this.__defineGetter__("regexp", () => regexp); |
} |
else |
{ |
// No need to convert this filter to regular expression yet, do it on demand |
this.regexpSource = regexpSource; |
} |
} |
exports.RegExpFilter = RegExpFilter; |
@@ -517,17 +523,17 @@ RegExpFilter.prototype = |
.replace(/^\\\|/, "^") // process anchor at expression start |
.replace(/\\\|$/, "$") // process anchor at expression end |
.replace(/^(\.\*)/, "") // remove leading wildcards |
.replace(/(\.\*)$/, ""); // remove trailing wildcards |
let regexp = new RegExp(source, this.matchCase ? "" : "i"); |
delete this.regexpSource; |
- this.__defineGetter__("regexp", function() regexp); |
+ this.__defineGetter__("regexp", () => regexp); |
return this.regexp; |
}, |
/** |
* Content types the filter applies to, combination of values from RegExpFilter.typeMap |
* @type Number |
*/ |
contentType: 0x7FFFFFFF, |
/** |