Skip to content

Commit

Permalink
needed that boolean cast on the ~ indexOf trick.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Mar 30, 2011
1 parent c7860d0 commit 2661e86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modernizr.js
Expand Up @@ -229,7 +229,7 @@ window.Modernizr = (function(window,document,undefined){
* contains returns a boolean for if substr is found within str.
*/
function contains( str, substr ) {
return ~(''+str).indexOf( substr );
return !!~(''+str).indexOf( substr );
}

/**
Expand Down Expand Up @@ -840,7 +840,7 @@ window.Modernizr = (function(window,document,undefined){
// then based on that boolean, define an appropriate className
// and push it into an array of classes we'll join later.
featurename = feature.toLowerCase();
ret[ featurename ] = !!tests[ feature ]();
ret[ featurename ] = tests[ feature ]();

classes.push( ( ret[ featurename ] ? '' : 'no-' ) + featurename );
}
Expand Down

0 comments on commit 2661e86

Please sign in to comment.