Skip to content

Commit

Permalink
Do NOT cast test to a Boolean. Truthy/falsy values are okay and cas…
Browse files Browse the repository at this point in the history
…ting will break some of the built in tests that use a Boolean *object* with added properties (the audio/video tests do this).


Fun fact: `!!new Boolean(false) === true`
  • Loading branch information
David Murdoch committed Nov 30, 2011
1 parent 1c2feb5 commit f8ccf69
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 @@ -902,7 +902,7 @@ window.Modernizr = (function( window, document, undefined ) {
test = typeof test == 'function' ? test() : test;

docElement.className += ' ' + (test ? '' : 'no-') + feature;
Modernizr[feature] = !!test;
Modernizr[feature] = test;

}

Expand Down

0 comments on commit f8ccf69

Please sign in to comment.