(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, kind ast.Kind, flags ParseFlags)
| 3430 | } |
| 3431 | |
| 3432 | func (p *Parser) parseAccessorDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, kind ast.Kind, flags ParseFlags) *ast.Node { |
| 3433 | name := p.parsePropertyName() |
| 3434 | typeParameters := p.parseTypeParameters() |
| 3435 | parameters := p.parseParameters(ParseFlagsNone) |
| 3436 | returnType := p.parseReturnType(ast.KindColonToken, false /*isType*/) |
| 3437 | body := p.parseFunctionBlockOrSemicolon(flags, nil /*diagnosticMessage*/) |
| 3438 | var result *ast.Node |
| 3439 | // Keep track of `typeParameters` (for both) and `type` (for setters) if they were parsed those indicate grammar errors |
| 3440 | if kind == ast.KindGetAccessor { |
| 3441 | result = p.factory.NewGetAccessorDeclaration(modifiers, name, typeParameters, parameters, returnType, nil /*fullSignature*/, body) |
| 3442 | } else { |
| 3443 | result = p.factory.NewSetAccessorDeclaration(modifiers, name, typeParameters, parameters, returnType, nil /*fullSignature*/, body) |
| 3444 | } |
| 3445 | p.withJSDoc(p.finishNode(result, pos), jsdoc) |
| 3446 | if flags&ParseFlagsType == 0 { |
| 3447 | p.checkJSSyntax(result) |
| 3448 | } |
| 3449 | return result |
| 3450 | } |
| 3451 | |
| 3452 | func (p *Parser) parsePropertyName() *ast.Node { |
| 3453 | saveHasAwaitIdentifier := p.statementHasAwaitIdentifier |
no test coverage detected