Allow the `await` keyword at the top-level within JavaScript modules.

Motivation

Allows more seamless integration of async calls into the module loading process. Today this is accomplished by wrapping modules in async functions, but this pushes complexity into dependent modules and exposes implementation details.

Demo

Documentation

Specification

Editor's draft

Status in Chromium

Blink>JavaScript>Language


Enabled by default (tracking bug) in:

  • Chrome for desktop release 89
  • Chrome for Android release 89
  • Android WebView release 89

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Search tags

top_level_await,

Last updated on 2021-02-22