Skip to content

Commit

Permalink
Add check to verify that enableClasses has been initialized.
Browse files Browse the repository at this point in the history
During custom builds that exclude this functionality enableClasses is never initialized, causing errors to be raised on this line. This patch verifies that enableClasses is initialized before testing the value of enableClasses.
  • Loading branch information
travisp committed Jul 19, 2012
1 parent ac7b9f5 commit 39fc8fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ window.Modernizr = (function( window, document, undefined ) {

test = typeof test == 'function' ? test() : test;

if (enableClasses) {
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className += ' ' + (test ? '' : 'no-') + feature;
}
Modernizr[feature] = test;
Expand Down

0 comments on commit 39fc8fa

Please sign in to comment.