Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add check to verify that enableClasses has been initialized. #635

Merged
merged 1 commit into from

4 participants

@travisp

During custom builds of Modernizr that do not have the "add css class" functionality, the enableClasses variable is never initialized, causing errors to be raised on this line. This patch verifies that enableClasses is initialized before testing the value of enableClasses.

@travisp travisp Add check to verify that enableClasses has been initialized.
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.
39fc8fa
@paulirish
Owner

Good call. Thank you

In the future I think we'll fix up how we do a custom build with this so it'll be a flag instead of just dropping the code.

@paulirish paulirish merged commit 0941909 into from
@auchenberg

When is this fix being pushed to http://modernizr.com/download/? Just experienced it when doing a custom build.

@andreylis

Not fixed yet

@paulirish
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 19, 2012
  1. @travisp

    Add check to verify that enableClasses has been initialized.

    travisp authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  modernizr.js
View
2  modernizr.js
@@ -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;
Something went wrong with that request. Please try again.