Skip to content

Thenable coercion weak map logic is still not quite right #79

@domenic

Description

@domenic
  • As pointed out in Thenable coercion should use thenable.then(deferred.resolve, deferred.reject), not deferred.resolve(thenable) #77, only one of its two entry points is currently guarded by an IsPromise, which is inconsistent and bad. So in some cases real promises get into it and sometimes they don't.
  • Why are we handling real promises differently from thenables in the first place? Real promises can have their then methods overriden to do unspeakable things anyway. I am pretty sure (but should check) that this is handled fine; we don't use real-promiseness to give any new capabilities, but only to bypass the memoization step.

I am tempted to scrap the thenable coercion weak map entirely, but need to have some discussions with various stakeholders first to better understand its purpose and how it should behave under various degenerate situations. Filing this to track that.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions