Twitter | Pretraživanje | |
V8
🚀 Top-level await makes it possible to use the `await` keyword outside of async functions in JavaScript modules! explains:
Reply Retweet Označi sa "sviđa mi se" More
Jonas Jonas 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
So I'll be able to use it in node if I use the experimental es modules?
Reply Retweet Označi sa "sviđa mi se"
sMyle 8. lis
Odgovor korisniku/ci @joshmallox @v8js
not yet. This landed in V8 master, so it will be another couple months for that to land in Node
Reply Retweet Označi sa "sviđa mi se"
Mehul Mohan 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
Isn’t that blocking main thread now?
Reply Retweet Označi sa "sviđa mi se"
sMyle 8. lis
Odgovor korisniku/ci @mehulmpt @v8js
Top-Level await won't block the main thread. It will block execution of parents until bindings are exported, but siblings will be able to execute independently.
Reply Retweet Označi sa "sviđa mi se"
Adam Argyle 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
Reply Retweet Označi sa "sviđa mi se"
Ingvar Stepanyan 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
To be completely fair, the first example would need to show how to deal with propagating errors, too. It's so cool you don't need to think about that anymore!
Reply Retweet Označi sa "sviđa mi se"
Sergey Rubanov 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
AFAIR it's also available in Safari's Inspector REPL
Reply Retweet Označi sa "sviđa mi se"
Andy Hayden 8. lis
Odgovor korisniku/ci @v8js @stefanpenner @MylesBorins
what about top level `for await`?
Reply Retweet Označi sa "sviđa mi se"
sMyle 8. lis
Odgovor korisniku/ci @andyhayden1 @v8js @stefanpenner
Reply Retweet Označi sa "sviđa mi se"
Josh Weston 8. lis
Odgovor korisniku/ci @v8js @MylesBorins
Great improvement; I've been anxiously (a)waiting for this one!
Reply Retweet Označi sa "sviđa mi se"