Skip to content

Conversation

@jsor
Copy link
Member

@jsor jsor commented Oct 24, 2016

This adds a check to Promise\resolve when resolving foreign Thenables if a done() method exists and uses this instead of then().

Ref #66

@jsor jsor added this to the v2.5 milestone Oct 24, 2016
@jsor jsor mentioned this pull request Oct 24, 2016
@jsor
Copy link
Member Author

jsor commented Nov 9, 2016

Ping @WyriHaximus @clue @cboden

@clue
Copy link
Member

clue commented Nov 9, 2016

Not a big fan of this TBH.

Do any of the known "foreign thenables" actually implement the done() method?

I wonder if there's no way we can provide our done() logic even if the underlying foreign promise only offers a then()method?

@jsor
Copy link
Member Author

jsor commented Nov 10, 2016

@clue I haven't found a way to do so. The thrown exceptions are swallowed here.

The only way i know to break out here, would be to use an event loop and throw on nextTick.

@jsor
Copy link
Member Author

jsor commented Dec 22, 2016

Closing for too much duck-typing :D.
async-interop/promise (#76) might be a better option for interoperability.

@jsor jsor closed this Dec 22, 2016
@jsor jsor deleted the 2.x-resolve-donables branch December 22, 2016 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants