tc39 / proposal-do-expressions

Proposal for `do` expressions
MIT License
1.11k stars 14 forks source link

Async identifier/keyword reference inside class static block #66

Closed Kingwl closed 3 years ago

Kingwl commented 3 years ago

According to proposal-class-static-block

const async = 42

class C {
  static {
    const foo = await // illegal
    const bar = do {
        const b = await // legal or illegal ?
    }
  }
}

It's basically means does the do expression is a function boundary( https://github.com/tc39/proposal-class-static-block/issues/43) ? Even the concept function boundary is not well-defined.

bakkot commented 3 years ago

Assuming you mean await rather than async, illegal. do has the same restrictions on syntax as the surrounding context.