News for hackers. Stuff that matters.
Re:LoadJS – A tiny async loader for modern browsers (710 bytes) by thomasfoster96 on Wednesday December 14, 2016 @03:24AM (#13174592)
Someone please correct me if I’m wrong, but I’m pretty sure await has to be within an async function [0].

[0] https://github.com/tc39/ecmascript-asyncawait/issues/36

Re:LoadJS – A tiny async loader for modern browsers (710 bytes) by Klathmon on Wednesday December 14, 2016 @06:56AM (#13175339)
Yeah but we can use the same "trick" we've been using for years, an IIFE:

    (async () => { 
      // Code...
    })()
Re:LoadJS – A tiny async loader for modern browsers (710 bytes) by denisw on Wednesday December 14, 2016 @12:43PM (#13177927)
This will wait within the function, but won't block the caller.
Re:LoadJS – A tiny async loader for modern browsers (710 bytes) by Klathmon on Wednesday December 14, 2016 @12:51PM (#13178018)
which is what it should do

If you want the caller to "block", then it needs to await or .then() what it's calling.