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

Unified Diff: lib/filterClasses.js

Issue 6305806509146112: Issue 427 - Remove non-standard function and getter syntax (Closed)
Patch Set: Created May 5, 2014, 12:18 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterStorage.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
+ 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", function() { return 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", function() { return regexp; });
return this.regexp;
},
/**
* Content types the filter applies to, combination of values from RegExpFilter.typeMap
* @type Number
*/
contentType: 0x7FFFFFFF,
/**
« no previous file with comments | « lib/elemHide.js ('k') | lib/filterStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld