Skip to content

Commit

Permalink
Allow chaining in all code paths within addTest and remove some trail…
Browse files Browse the repository at this point in the history
…ing white-space.
  • Loading branch information
David Murdoch committed Nov 30, 2011
1 parent 1991630 commit 5fa7abf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ window.Modernizr = (function( window, document, undefined ) {
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == "object" ) {
for ( var key in feature ) {
if ( hasOwnProperty( feature, key ) ) {
if ( hasOwnProperty( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
}
}
Expand All @@ -893,10 +893,10 @@ window.Modernizr = (function( window, document, undefined ) {
if ( Modernizr[feature] !== undefined ) {
// we're going to quit if you're trying to overwrite an existing test
// if we were to allow it, we'd do this:
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// var re = new RegExp("\\b(no-)?" + feature + "\\b");
// docElement.className = docElement.className.replace( re, '' );
// but, no rly, stuff 'em.
return;
return Modernizr;
}

test = typeof test == "boolean" ? test : !!test();
Expand All @@ -908,7 +908,7 @@ window.Modernizr = (function( window, document, undefined ) {

return Modernizr; // allow chaining.
};


// Reset modElem.cssText to nothing to reduce memory footprint.
setCss('');
Expand Down

0 comments on commit 5fa7abf

Please sign in to comment.