$.when and a deferred with notifyWith bug

by gonchuki

JavaScript

var foo = $.Deferred(),
    bar = $.Deferred();


foo.progress(function(str, a) { console.log(str), console.info(a); });
bar.progress(function(str) { console.log(str); });

$.when(foo, bar).progress(function(str) {
    console.log('$.when progress:' + str);
    console.info(arguments)
}).done(function() {
    console.log('All done');
});


setTimeout(function() { foo.notify('hi from foo', 'turd') }, 500)
setTimeout(function() { bar.notify('hi from bar') }, 1500)
setTimeout(function() { foo.notifyWith(window, ['hi from foo, using notifyWith', 'rly?'], 'ha') }, 2500)