Commit 31b3c44d authored by jeresig's avatar jeresig

Merge branch 'bug_4366' of https://github.com/jboesch/jquery into jboesch-bug_4366

parents 2d27ac4d 926884bf
...@@ -613,8 +613,11 @@ jQuery.extend({ ...@@ -613,8 +613,11 @@ jQuery.extend({
} }
} }
} else { } else {
for ( var value = object[0]; for ( ; i < length; ) {
i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
break;
}
}
} }
} }
......
...@@ -818,7 +818,7 @@ test("jQuery.extend(Object, Object)", function() { ...@@ -818,7 +818,7 @@ test("jQuery.extend(Object, Object)", function() {
}); });
test("jQuery.each(Object,Function)", function() { test("jQuery.each(Object,Function)", function() {
expect(13); expect(14);
jQuery.each( [0,1,2], function(i, n){ jQuery.each( [0,1,2], function(i, n){
equals( i, n, "Check array iteration" ); equals( i, n, "Check array iteration" );
}); });
...@@ -850,6 +850,13 @@ test("jQuery.each(Object,Function)", function() { ...@@ -850,6 +850,13 @@ test("jQuery.each(Object,Function)", function() {
f[i] = 'baz'; f[i] = 'baz';
}); });
equals( "baz", f.foo, "Loop over a function" ); equals( "baz", f.foo, "Loop over a function" );
var stylesheet_count = 0;
jQuery.each(document.styleSheets, function(i){
stylesheet_count++;
});
equals(stylesheet_count, 2, "should not throw an error in IE while looping over document.styleSheets and return proper amount");
}); });
test("jQuery.makeArray", function(){ test("jQuery.makeArray", function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment