News for hackers. Stuff that matters.
Re:Building a JavaScript Promise from Scratch by wakeywakeywakey on Wednesday October 25, 2017 @12:45PM (#15551693)
There is a subtle issue here: all parts of the suggested promise implementation run synchronously.

In spec-compliant promises, the executor runs synchronously [1][2], but the promise must wait until the next turn of the event loop [3] before calling the 'then' method.

[1] https://stackoverflow.com/questions/36726890/why-are-javascr...

[2] https://stackoverflow.com/questions/36932244/what-is-the-int...

[3] https://github.com/promises-aplus/promises-spec/issues/68