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

Unified Diff: lib/matcher.js

Issue 8835063: Fixed: "Cannot convert `text` to object" exception in _getRuleText() caused by raw regular expressi… (Closed)
Patch Set: Created Nov. 14, 2012, 11:21 a.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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/matcher.js
===================================================================
--- a/lib/matcher.js
+++ b/lib/matcher.js
@@ -157,16 +157,19 @@
return rule;
},
add: function(filter)
{
if (filter.text in this._rules)
return;
+ if (!filter.regexpSource) // Regular expressions aren't supported
Felix Dahlke 2012/11/14 12:45:26 So it's a regular expression if regexpSource is fa
Wladimir Palant 2012/11/14 13:25:30 Yes - for raw regexps we calculate the regexp prop
+ return;
+
var rule = this._generateRule(filter);
opera.extension.urlfilter[rule.type].add(rule.text, rule.options);
this._rules[filter.text] = rule;
},
remove: function(filter)
{
if (!(filter.text in this._rules))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld