()
| 5469 | } |
| 5470 | |
| 5471 | function parseObjectProperty() { |
| 5472 | var token, key, id, param, computed, |
| 5473 | marker = markerCreate(), returnType, typeParameters; |
| 5474 | |
| 5475 | token = lookahead; |
| 5476 | computed = (token.value === '[' && token.type === Token.Punctuator); |
| 5477 | |
| 5478 | if (token.type === Token.Identifier || computed || matchAsync()) { |
| 5479 | id = parseObjectPropertyKey(); |
| 5480 | |
| 5481 | if (match(':')) { |
| 5482 | lex(); |
| 5483 | |
| 5484 | return markerApply( |
| 5485 | marker, |
| 5486 | delegate.createProperty( |
| 5487 | 'init', |
| 5488 | id, |
| 5489 | parseAssignmentExpression(), |
| 5490 | false, |
| 5491 | false, |
| 5492 | computed |
| 5493 | ) |
| 5494 | ); |
| 5495 | } |
| 5496 | |
| 5497 | if (match('(') || match('<')) { |
| 5498 | if (match('<')) { |
| 5499 | typeParameters = parseTypeParameterDeclaration(); |
| 5500 | } |
| 5501 | return markerApply( |
| 5502 | marker, |
| 5503 | delegate.createProperty( |
| 5504 | 'init', |
| 5505 | id, |
| 5506 | parsePropertyMethodFunction({ |
| 5507 | generator: false, |
| 5508 | async: false, |
| 5509 | typeParameters: typeParameters |
| 5510 | }), |
| 5511 | true, |
| 5512 | false, |
| 5513 | computed |
| 5514 | ) |
| 5515 | ); |
| 5516 | } |
| 5517 | |
| 5518 | // Property Assignment: Getter and Setter. |
| 5519 | |
| 5520 | if (token.value === 'get') { |
| 5521 | computed = (lookahead.value === '['); |
| 5522 | key = parseObjectPropertyKey(); |
| 5523 | |
| 5524 | expect('('); |
| 5525 | expect(')'); |
| 5526 | if (match(':')) { |
| 5527 | returnType = parseTypeAnnotation(); |
| 5528 | } |
no test coverage detected