Tiny refactor.

This commit is contained in:
Nicolas Stepien 2012-08-08 17:52:10 +02:00
parent f2ff7ab1be
commit c6a44d095c
2 changed files with 16 additions and 16 deletions

View File

@ -564,16 +564,16 @@
if (boards !== 'global' && boards.split(',').indexOf(g.BOARD) === -1) { if (boards !== 'global' && boards.split(',').indexOf(g.BOARD) === -1) {
continue; continue;
} }
try {
if (key === 'md5') { if (key === 'md5') {
regexp = regexp[1]; regexp = regexp[1];
} else { } else {
try {
regexp = RegExp(regexp[1], regexp[2]); regexp = RegExp(regexp[1], regexp[2]);
} } catch (err) {
} catch (e) { alert(err.message);
alert(e.message);
continue; continue;
} }
}
op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no'; op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'no';
stub = (function() { stub = (function() {
var _ref3; var _ref3;

View File

@ -437,16 +437,16 @@ Filter =
if boards isnt 'global' and boards.split(',').indexOf(g.BOARD) is -1 if boards isnt 'global' and boards.split(',').indexOf(g.BOARD) is -1
continue continue
try
if key is 'md5' if key is 'md5'
# MD5 filter will use strings instead of regular expressions. # MD5 filter will use strings instead of regular expressions.
regexp = regexp[1] regexp = regexp[1]
else else
try
# Please, don't write silly regular expressions. # Please, don't write silly regular expressions.
regexp = RegExp regexp[1], regexp[2] regexp = RegExp regexp[1], regexp[2]
catch e catch err
# I warned you, bro. # I warned you, bro.
alert e.message alert err.message
continue continue
# Filter OPs along with their threads, replies only, or both. # Filter OPs along with their threads, replies only, or both.