News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by ihuman on Tuesday September 24, 2019 @10:57PM (#21067162)
Are you sure? From what I can find, async [0] causes a function to a return a promise, which then returns the result. Await [1] takes a promise, and waits for it to either be resolved or rejected.

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re:V8 adds support for top-level await by matt-attack on Tuesday September 24, 2019 @11:46PM (#21067414)
> and waits for it

Yes but that doesn’t mean other lines of code can’t be executing while waiting. The waiting isn’t truly blocking the entire application. Plenty of other things can be happening.

Re:V8 adds support for top-level await by nemetroid on Wednesday September 25, 2019 @07:33AM (#21069681)
Sure, but the next line of the function awaiting the result can't execute while waiting.
Re:V8 adds support for top-level await by h8hawk on Wednesday September 25, 2019 @12:35AM (#21067639)
from your first link: "... , async/await is similar to combining generators and promises."