(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier)
| 36746 | return list && createNodeArray(list, pos); |
| 36747 | } |
| 36748 | function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { |
| 36749 | var pos = getNodePos(); |
| 36750 | var kind = token(); |
| 36751 | if (token() === 85 /* SyntaxKind.ConstKeyword */ && permitInvalidConstAsModifier) { |
| 36752 | // We need to ensure that any subsequent modifiers appear on the same line |
| 36753 | // so that when 'const' is a standalone declaration, we don't issue an error. |
| 36754 | if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { |
| 36755 | return undefined; |
| 36756 | } |
| 36757 | } |
| 36758 | else if (stopOnStartOfClassStaticBlock && token() === 124 /* SyntaxKind.StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { |
| 36759 | return undefined; |
| 36760 | } |
| 36761 | else if (hasSeenStaticModifier && token() === 124 /* SyntaxKind.StaticKeyword */) { |
| 36762 | return undefined; |
| 36763 | } |
| 36764 | else { |
| 36765 | if (!parseAnyContextualModifier()) { |
| 36766 | return undefined; |
| 36767 | } |
| 36768 | } |
| 36769 | return finishNode(factory.createToken(kind), pos); |
| 36770 | } |
| 36771 | /* |
| 36772 | * There are situations in which a modifier like 'const' will appear unexpectedly, such as on a class member. |
| 36773 | * In those situations, if we are entirely sure that 'const' is not valid on its own (such as when ASI takes effect |
no test coverage detected
searching dependent graphs…