Skip to content

Instantly share code, notes, and snippets.

@rodneyrehm
Created August 6, 2013 21:52
Show Gist options
  • Save rodneyrehm/6169060 to your computer and use it in GitHub Desktop.
Save rodneyrehm/6169060 to your computer and use it in GitHub Desktop.
debugging-games: spot-the-dot
// ruining debugging-games: spot-the-dot
$.fn.hasClass = (function(orig){
return function(className) {
if (typeof className !== 'string') {
throw new Error("jQuery.hasClass() expects a string!");
} else if (className.slice(0, 1) === '.') {
throw new Error("jQuery.hasClass() does not expect a . prefixing the className");
}
return orig.apply(this, arguments);
};
})($.fn.hasClass);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment