Prevent regexp errors with the filter.

This commit is contained in:
Nicolas Stepien 2011-12-13 17:13:09 +01:00
parent bc57aa561f
commit fbfdefa3e0
3 changed files with 12 additions and 2 deletions

View File

@ -537,7 +537,12 @@
for (_i = 0, _len = m.length; _i < _len; _i++) {
filter = m[_i];
f = filter.match(/^\/(.+)\/(\w*)$/);
this.regexps[key].push(RegExp(f[1], f[2]));
try {
this.regexps[key].push(RegExp(f[1], f[2]));
} catch (e) {
alert(e.message);
alert(e);
}
}
this.callbacks.push(this[key]);
}

View File

@ -1,4 +1,6 @@
master
- mayhem
prevent regexp errors with the filter
2.32.3
- mayhem

View File

@ -401,7 +401,10 @@ filter =
@regexps[key] = []
for filter in m
f = filter.match /^\/(.+)\/(\w*)$/
@regexps[key].push RegExp f[1], f[2]
try
@regexps[key].push RegExp f[1], f[2]
catch e
alert e.message
#only execute what's filterable
@callbacks.push @[key]