(i int)
| 499 | } |
| 500 | |
| 501 | func (p *Parser) parseToplevelStatement(i int) *ast.Node { |
| 502 | p.statementHasAwaitIdentifier = false |
| 503 | statement := p.parseStatement() |
| 504 | // Reparsed nodes (e.g. JSDoc @typedef) produced while parsing this statement are inserted |
| 505 | // into the statement list before this statement, so account for them when recording the |
| 506 | // statement's index for possibleAwaitSpans. |
| 507 | i += len(p.reparseList) |
| 508 | if p.statementHasAwaitIdentifier && statement.Flags&ast.NodeFlagsAwaitContext == 0 { |
| 509 | if len(p.possibleAwaitSpans) == 0 || p.possibleAwaitSpans[len(p.possibleAwaitSpans)-1] != i { |
| 510 | p.possibleAwaitSpans = append(p.possibleAwaitSpans, i, i+1) |
| 511 | } else { |
| 512 | p.possibleAwaitSpans[len(p.possibleAwaitSpans)-1] = i + 1 |
| 513 | } |
| 514 | } |
| 515 | return statement |
| 516 | } |
| 517 | |
| 518 | func (p *Parser) reparseTopLevelAwait(sourceFile *ast.SourceFile) *ast.Node { |
| 519 | if len(p.possibleAwaitSpans)%2 == 1 { |
nothing calls this directly
no test coverage detected