resolveWith fails on IE8 when called with no "args" argument
|Reported by:||Owned by:||jaubourg|
resolveWith method fails on IE8 (with and without IE7 compat mode) when called without its second argument ("
d = $.Deferred(); ... d.resolveWith(this);
According to the docs, this arguments is optional, so this would be a valid call, and it indeed works as expected on at least Firefox and Chrome. IE, on the other hand, fails with an "Object expected" error.
A very small test case for the problem is available at http://jsfiddle.net/martinsoto/BLDTG/. It affects both jQuery 1.5 and 1.5.1.
I could trace this to the
apply call at line 862 of
callbacks.shift().apply( context, args );
resolveWith is called without the
apply gets called here with an undefined but explicit second argument. This evidently makes IE choke.