Skip to content

Instantly share code, notes, and snippets.

@jinjor
Created February 13, 2015 16:07
Show Gist options
  • Select an option

  • Save jinjor/34d9ad541ea2212ac6e0 to your computer and use it in GitHub Desktop.

Select an option

Save jinjor/34d9ad541ea2212ac6e0 to your computer and use it in GitHub Desktop.
setImmediate with throw
var _setImmediate = function(f) {
setImmediate(function() {
try {
f.apply(null, arguments);
} catch (e) {
console.log('HAHAHA!');
}
});
};
_setImmediate(function() {
throw 'error!';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment