New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery.when doesn't recognize solitary thenables #2546

Closed
gibson042 opened this Issue Aug 19, 2015 · 1 comment

Comments

Projects
None yet
5 participants
@gibson042
Member

gibson042 commented Aug 19, 2015

jQuery.when( a ) does not look for a then method on its argument, which differs from its behavior in longer jQuery.when( a, … ) invocations. It should treat non-Deferred thenables identically in both cases.

http://jsfiddle.net/0r62we79/9/

@marcandre

This comment has been minimized.

Show comment
Hide comment
@marcandre

marcandre Aug 21, 2015

And I thought I was going crazy...

var failed = new Promise(function(resolve, reject) { reject('fail!'); });
$.when(failed).then(function(){console.log('Should not be here')});  // Not ok
$.when(failed, failed).then(function(){console.log('Should not be here either')}); // Ok

Currently outputs "Should not be here" to the console.

marcandre commented Aug 21, 2015

And I thought I was going crazy...

var failed = new Promise(function(resolve, reject) { reject('fail!'); });
$.when(failed).then(function(){console.log('Should not be here')});  // Not ok
$.when(failed, failed).then(function(){console.log('Should not be here either')}); // Ok

Currently outputs "Should not be here" to the console.

@timmywil timmywil self-assigned this Nov 9, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 11, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 11, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 11, 2015

timmywil added a commit to timmywil/jquery that referenced this issue Nov 13, 2015

@timmywil timmywil closed this in #2707 Nov 13, 2015

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.