Skip to content
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 · Fixed by #2707
Closed

jQuery.when doesn't recognize solitary thenables #2546

gibson042 opened this issue Aug 19, 2015 · 1 comment · Fixed by #2707

Comments

@gibson042
Copy link
Member

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
Copy link

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.

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

Successfully merging a pull request may close this issue.

5 participants