Re:Top-level await in JavaScript is a footgun
by domenicd on Wednesday September 14, 2016 @12:38PM
(#12498734)
It would block dependent module execution, but not dependent module fetching, which is the actual expensive part.
Re:Top-level await in JavaScript is a footgun
by s_kilk on Wednesday September 14, 2016 @03:12PM
(#12500285)
It's kinda funny how the semantics of this thing are so non-obvious and nuanced, that it takes so much effort to explain to people how it works :)
Re:Top-level await in JavaScript is a footgun
by domenicd on Wednesday September 14, 2016 @03:22PM
(#12500375)
It's not that complicated; unfortunately a lot of FUD has been spread about alternate models based on misconceptions, which definitely makes it tricky to explain because you have to overcome that FUD.
In other words, if you put
in the body of a module, wouldn't that block dependent modules for the duration of the loop?Would top-level await be different?
edit The premise, as I understand it, is that the module itself is treated as the "currently-executing method" for the purpose of the `await`.