Created
August 6, 2013 21:52
-
-
Save rodneyrehm/6169060 to your computer and use it in GitHub Desktop.
debugging-games: spot-the-dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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