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

Issue 8835063: Fixed: "Cannot convert `text` to object" exception in _getRuleText() caused by raw regular expressi… (Closed)

Created:
Nov. 14, 2012, 11:21 a.m. by Wladimir Palant
Modified:
Nov. 14, 2012, 4:25 p.m.
Reviewers:
Felix Dahlke
Visibility:
Public.

Description

Fixed: "Cannot convert `text` to object" exception in _getRuleText() caused by raw regular expressi…

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M lib/matcher.js View 1 chunk +3 lines, -0 lines 2 comments Download

Messages

Total messages: 3
Wladimir Palant
Nov. 14, 2012, 11:21 a.m. (2012-11-14 11:21:28 UTC) #1
Felix Dahlke
LGTM, assuming that line I found confusing is correct. http://codereview.adblockplus.org/8835063/diff/1/lib/matcher.js File lib/matcher.js (right): http://codereview.adblockplus.org/8835063/diff/1/lib/matcher.js#newcode165 lib/matcher.js:165: ...
Nov. 14, 2012, 12:45 p.m. (2012-11-14 12:45:26 UTC) #2
Wladimir Palant
Nov. 14, 2012, 1:25 p.m. (2012-11-14 13:25:30 UTC) #3
http://codereview.adblockplus.org/8835063/diff/1/lib/matcher.js
File lib/matcher.js (right):

http://codereview.adblockplus.org/8835063/diff/1/lib/matcher.js#newcode165
lib/matcher.js:165: if (!filter.regexpSource) // Regular expressions aren't
supported
On 2012/11/14 12:45:26, Felix H. Dahlke wrote:
> So it's a regular expression if regexpSource is falsy?

Yes - for raw regexps we calculate the regexp property right away, for
everything else we set regexpSource and do it on demand. Relying on regexpSource
here is still a hack, something that we probably need to improve in future.

Powered by Google App Engine
This is Rietveld