News for hackers. Stuff that matters.
Re:Top-level await in JavaScript is a footgun by egeozcan on Wednesday September 14, 2016 @02:17PM (#12499755)
If you run an await as a first thing in the top-level, you have nothing in the event loop to run. Await blocks everything after itself, and that is very dangerous if done on the top-level.
Re:Top-level await in JavaScript is a footgun by BinaryIdiot on Wednesday September 14, 2016 @03:11PM (#12500271)
In that script, yes. But in JavaScript you can have multiple scripts :)
Re:Top-level await in JavaScript is a footgun by egeozcan on Wednesday September 14, 2016 @03:29PM (#12500434)
> in JavaScript you can have multiple scripts

You mean, you can embed multiple script elements in HTML? Yes. But allowing global await in ES spec means also enabling it in node.

Re:Top-level await in JavaScript is a footgun by bmeck on Wednesday September 14, 2016 @04:23PM (#12500927)
or you could just do `import('a'); import('b');` to load `a` and `b` in parallel