r/javascript • • Oct 11 '17

JavaScript's Promise is Memory Unsafe

https://alexn.org/blog/2017/10/11/javascript-promise-memory-unsafe.html
70 Upvotes

77 comments sorted by

View all comments

8

u/w00t_loves_you Oct 11 '17

Right, but the native await code handles tail recursion properly, no?

Also, did you try this with Bluebird, it might be smarter about forwarding resolutions?

6

u/alexelcu Oct 11 '17

No, that loop using await is not tail recursion and the return await sample also crashes.

I have not tried with Bluebird. Will do so later, article talks about the standard Promise implementation.

2

u/w00t_loves_you Oct 12 '17

Well, thanks for the article, you got a decent amount of downvotes, but this is reddit ;)

This discussion made me realize I am doing this in a task queue because I was assuming TCO, and I am using Bluebird so I lucked out!