codemodsquad / asyncify

Don't keep your promises 😉
MIT License
13 stars 6 forks source link

Doesn't preserve semantics for non-function passed to onFulfilled/onRejected #15

Closed jedwards1211 closed 4 years ago

jedwards1211 commented 4 years ago

I forgot about this important detail of .then:

If it is not a function, it is internally replaced with an "Identity" function (it returns the received argument).

Right now asyncify always replaces A.then(B) with await B(await A) if B isn't a function expression. I need to walk the scope to determine if it's a function expression or not, and if it's impossible to tell, replace with a runtime check and developer warning.

jedwards1211 commented 4 years ago

:tada: This issue has been resolved in version 2.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: