You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Promises returned from generators are not resolved automatically #64
In Q, if an async generator returns a promise, that promise is resolved and the resolved value is passed on. In Bluebird, the promise itself is passed along as the next value:
But that seems like an unnecessary extra step that could be avoided, and I think it goes against expectations coming from Promise.try(). Is this behavior intentional?
To be fair, in C# you would write return await and not return to return from an async function.
The Bluebird behavior seems nice (and correct) but I see your point - this is inconsistent with the way promises unwrap. Definitely something we need to think about.
Activity
benjamingr commentedon Jan 11, 2014
To be fair, in C# you would write
return awaitand notreturnto return from an async function.The Bluebird behavior seems nice (and correct) but I see your point - this is inconsistent with the way promises unwrap. Definitely something we need to think about.
petkaantonov commentedon Jan 11, 2014
Yea confirmed as bug.
benjamingr commentedon Jan 11, 2014
@petkaantonov are you sure returning a promise acting like in thenables is the correct behavior?
petkaantonov commentedon Jan 11, 2014
Yes it is always without any doubt a bug if you get a promise as a
.thenargument