try / catch

This commit is contained in:
James Campos 2011-10-11 13:15:57 -07:00
parent a3b1483052
commit 2f2104a672
2 changed files with 17 additions and 5 deletions

View File

@ -2966,7 +2966,7 @@
};
Main = {
init: function() {
var cutoff, hiddenThreads, id, lastChecked, nodes, now, timestamp, tzOffset, _ref;
var callback, cutoff, hiddenThreads, id, lastChecked, nodes, now, timestamp, tzOffset, _i, _len, _ref, _ref2;
$.unbind(document, 'DOMContentLoaded', Main.init);
if (location.hostname === 'sys.4chan.org') {
QR.sys();
@ -3096,9 +3096,16 @@
}
}
nodes = $$('.op, a + table');
g.callbacks.forEach(function(callback) {
return nodes.forEach(callback);
});
_ref2 = g.callbacks;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
callback = _ref2[_i];
try {
nodes.forEach(callback);
} catch (e) {
alert(e);
continue;
}
}
$.bind($('form[name=delform]'), 'DOMNodeInserted', nodeInserted);
options.init();
if (!$.get('firstrun')) {

View File

@ -2362,7 +2362,12 @@ Main =
expandComment.init()
nodes = $$ '.op, a + table'
g.callbacks.forEach (callback) -> nodes.forEach callback
for callback in g.callbacks
try
nodes.forEach callback
catch e
alert e
continue
$.bind $('form[name=delform]'), 'DOMNodeInserted', nodeInserted
options.init()