Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -1037,13 +1037,18 @@ |
get regexpString() |
{ |
// Despite this property being cached, the getter is called |
// several times on Safari, due to WebKit bug 132872 |
let prop = Object.getOwnPropertyDescriptor(this, "regexpString"); |
if (prop) |
return prop.value; |
- let regexp = Filter.toRegExp(this.regexpSource); |
+ let regexp; |
+ if (this.regexpSource.length >= 2 && this.regexpSource[0] == "/" && |
+ this.regexpSource[this.regexpSource.length - 1] == "/") |
Wladimir Palant
2016/11/08 17:41:34
Well, accessing this.regexpSource four times is ob
|
+ regexp = this.regexpSource.slice(1, -1); |
+ else |
+ regexp = Filter.toRegExp(this.regexpSource); |
Object.defineProperty(this, "regexpString", {value: regexp}); |
return regexp; |
} |
}); |