Skip to content
This repository
Browse code

Fixed failing test and linting issues.

- Leaked globals unit test is too flaky and now we have linting it's no longer relevant.
- Fixed up some linting issues.
  • Loading branch information...
commit 362bcebca514538b6ad17a4ba54c500936fa9d01 1 parent 58221c7
Ryan Seddon authored August 11, 2012
7  feature-detects/css-backgroundsizecover.js
... ...
@@ -1,9 +1,10 @@
1 1
 
2 2
 // developer.mozilla.org/en/CSS/background-size
3 3
 
4  
-Modernizr.testStyles( '#modernizr{background-size:cover}', function( elem ) { 
5  
-	var style = window.getComputedStyle
6  
-		? window.getComputedStyle( elem, null )
  4
+Modernizr.testStyles( '#modernizr{background-size:cover}', function( elem ) {
  5
+	var style = window.getComputedStyle ?
  6
+		window.getComputedStyle( elem, null )
7 7
 		: elem.currentStyle;
  8
+		
8 9
 	Modernizr.addTest( 'bgsizecover', style.backgroundSize == 'cover' );
9 10
 });
2  feature-detects/css-filters.js
... ...
@@ -1,7 +1,7 @@
1 1
 // https://github.com/Modernizr/Modernizr/issues/615
2 2
 // documentMode is needed for false positives in oldIE, please see issue above
3 3
 Modernizr.addTest('cssfilters', function() {
4  
-    el = document.createElement('div');
  4
+    var el = document.createElement('div');
5 5
     el.style.cssText = Modernizr._prefixes.join('filter' + ':blur(2px); ');
6 6
     return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));
7 7
 });
6  feature-detects/css-subpixelfont.js
@@ -14,9 +14,9 @@ Modernizr.addTest('subpixelfont', function() {
14 14
 
15 15
         subpixel.innerHTML = 'This is a text written in Arial';
16 16
 
17  
-        bool = window.getComputedStyle
18  
-            ? window.getComputedStyle(subpixel, null).getPropertyValue("width") !== '44px'
19  
-            : false;   
  17
+        bool = window.getComputedStyle ?
  18
+            window.getComputedStyle(subpixel, null).getPropertyValue("width") !== '44px'
  19
+            : false;
20 20
     }, 1, ['subpixel']);
21 21
 
22 22
     return bool;
17  test/js/unit.js
@@ -28,23 +28,6 @@ test("globals set up", function() {
28 28
 
29 29
 	ok(window.Modernizr, 'global modernizr object created');
30 30
 
31  
-  // this comes from kangax's detect-global.js
32  
-
33  
-    var globArr = Object.keys(__globals);
34  
-
35  
-    // remove Modernizr and html5
36  
-    var leakedGlobArr = [''].concat(globArr).concat([''])
37  
-                            .join(',')
38  
-                            .replace(',Modernizr','').replace(',html5','')
39  
-                            .replace('URL','') // lazily added in Opera it seems.
40  
-                            .replace(/,script\w+/,'') // placed by jQuery
41  
-                            .split(',');
42  
-
43  
-    equal('', leakedGlobArr.pop(), 'retrieved my empty item from the end');
44  
-    equal('', leakedGlobArr.shift(), 'retrieved my empty item from the front');
45  
-
46  
-	equal(leakedGlobArr.toString(), [].toString(), 'no global variables should leak (other than Modernizr and iepp)');
47  
-
48 31
 });
49 32
 
50 33
 test("bind is implemented", function() {

0 notes on commit 362bceb

Please sign in to comment.
Something went wrong with that request. Please try again.