Fixes #8692. Strange FF4 bug: values changed onto the arguments object sometimes end up as undefined values outside the $.when method. Cloning the object into a fresh array solves the issue.

This commit is contained in:
jaubourg 2011-03-30 18:54:32 +02:00
parent 2555a5a232
commit f2ce87df8e

View file

@ -144,7 +144,10 @@ jQuery.extend({
return function( value ) { return function( value ) {
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
if ( !( --count ) ) { if ( !( --count ) ) {
deferred.resolveWith( deferred, args ); // Strange bug in FF4:
// Values changed onto the arguments object sometimes end up as undefined values
// outside the $.when method. Cloning the object into a fresh array solves the issue
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
} }
}; };
} }