Asynchronous stack traces: why `await` beats `Promise#then()`

Compared to using promises directly, not only can async and await make code more readable for developers — they enable some interesting optimizations in JavaScript engines, too! This write-up is about one such optimization involving stack traces for as…


This content originally appeared on Mathias Bynens and was authored by Mathias

Compared to using promises directly, not only can async and await make code more readable for developers — they enable some interesting optimizations in JavaScript engines, too! This write-up is about one such optimization involving stack traces for asynchronous code.


This content originally appeared on Mathias Bynens and was authored by Mathias


Print Share Comment Cite Upload Translate
APA
Mathias | Sciencx (2023-03-29T01:50:53+00:00) » Asynchronous stack traces: why `await` beats `Promise#then()`. Retrieved from https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/.
MLA
" » Asynchronous stack traces: why `await` beats `Promise#then()`." Mathias | Sciencx - Tuesday September 12, 2017, https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/
HARVARD
Mathias | Sciencx Tuesday September 12, 2017 » Asynchronous stack traces: why `await` beats `Promise#then()`., viewed 2023-03-29T01:50:53+00:00,<https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/>
VANCOUVER
Mathias | Sciencx - » Asynchronous stack traces: why `await` beats `Promise#then()`. [Internet]. [Accessed 2023-03-29T01:50:53+00:00]. Available from: https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/
CHICAGO
" » Asynchronous stack traces: why `await` beats `Promise#then()`." Mathias | Sciencx - Accessed 2023-03-29T01:50:53+00:00. https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/
IEEE
" » Asynchronous stack traces: why `await` beats `Promise#then()`." Mathias | Sciencx [Online]. Available: https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/. [Accessed: 2023-03-29T01:50:53+00:00]
rf:citation
» Asynchronous stack traces: why `await` beats `Promise#then()` | Mathias | Sciencx | https://www.scien.cx/2017/09/12/asynchronous-stack-traces-why-await-beats-promisethen/ | 2023-03-29T01:50:53+00:00
https://github.com/addpipe/simple-recorderjs-demo