From: Dave Methvin Date: Tue, 21 Dec 2010 15:00:49 +0000 (-0500) Subject: Use for loop instead of for/in loop to protect sanctity of Array.prototype. Fixes... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=acab4ab0e50fadacb106468b1449643b9a03826b Use for loop instead of for/in loop to protect sanctity of Array.prototype. Fixes #7817. Test case for this commit is shared with the fix for #6355, https://github.com/jquery/jquery/pull/140 . --- diff --git a/src/xhr.js b/src/xhr.js index 57903e0..4896e6c 100644 --- a/src/xhr.js +++ b/src/xhr.js @@ -87,7 +87,7 @@ jQuery.xhr = function( _native ) { } // Apply option prefilters - for (i in prefilters) { + for ( i = 0; i < prefilters.length; i++ ) { prefilters[i](s); }