deno.com

no-top-level-await

禁止使用顶层 await 表达式。

在通过 dnt 分发 CommonJS/UMD 时,不能使用顶层 await。

无效:

await foo();
for await (item of items) {}

有效:

async function foo() {
  await task();
}
async function foo() {
  for await (item of items) {}
}

你找到需要的内容了吗?

隐私政策