Ignore strict mode flag because we will report an error in type checker instead.
()
| 6276 | |
| 6277 | // Ignore strict mode flag because we will report an error in type checker instead. |
| 6278 | func (p *Parser) isIdentifier() bool { |
| 6279 | if p.token == ast.KindIdentifier { |
| 6280 | return true |
| 6281 | } |
| 6282 | // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is |
| 6283 | // considered a keyword and is not an identifier. |
| 6284 | // If we have a 'await' keyword, and we're in the [Await] context, then 'await' is |
| 6285 | // considered a keyword and is not an identifier. |
| 6286 | if p.token == ast.KindYieldKeyword && p.inYieldContext() || p.token == ast.KindAwaitKeyword && p.inAwaitContext() { |
| 6287 | return false |
| 6288 | } |
| 6289 | return p.token > ast.KindLastReservedWord |
| 6290 | } |
| 6291 | |
| 6292 | func (p *Parser) isBindingIdentifier() bool { |
| 6293 | // `let await`/`let yield` in [Yield] or [Await] are allowed here and disallowed in the binder. |
no test coverage detected