Skip to content

Use done() if available when resolving foreign thenables - #68

Closed
jsor wants to merge 1 commit into
2.xfrom
2.x-resolve-donables
Closed

jsor wants to merge 1 commit into
2.xfrom
2.x-resolve-donables

Conversation

@jsor

@jsor jsor commented Oct 24, 2016

Copy link
Copy Markdown
Member

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

jsor commented Nov 9, 2016

Copy link
Copy Markdown
Member Author

Ping @WyriHaximus @clue @cboden

@clue

clue commented Nov 9, 2016

Copy link
Copy Markdown
Member

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

jsor commented Nov 10, 2016

Copy link
Copy Markdown
Member Author

@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

jsor commented Dec 22, 2016

Copy link
Copy Markdown
Member Author

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.

3 participants