(inOuterAwaitContext, allowAmbiguity)
| 33480 | return parseParameterWorker(inOuterAwaitContext, /*allowAmbiguity*/ false); |
| 33481 | } |
| 33482 | function parseParameterWorker(inOuterAwaitContext, allowAmbiguity) { |
| 33483 | if (allowAmbiguity === void 0) { allowAmbiguity = true; } |
| 33484 | var pos = getNodePos(); |
| 33485 | var hasJSDoc = hasPrecedingJSDocComment(); |
| 33486 | // FormalParameter [Yield,Await]: |
| 33487 | // BindingElement[?Yield,?Await] |
| 33488 | // Decorators are parsed in the outer [Await] context, the rest of the parameter is parsed in the function's [Await] context. |
| 33489 | var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators(); |
| 33490 | if (token() === 108 /* SyntaxKind.ThisKeyword */) { |
| 33491 | var node_1 = factory.createParameterDeclaration(decorators, |
| 33492 | /*modifiers*/ undefined, |
| 33493 | /*dotDotDotToken*/ undefined, createIdentifier(/*isIdentifier*/ true), |
| 33494 | /*questionToken*/ undefined, parseTypeAnnotation(), |
| 33495 | /*initializer*/ undefined); |
| 33496 | if (decorators) { |
| 33497 | parseErrorAtRange(decorators[0], ts.Diagnostics.Decorators_may_not_be_applied_to_this_parameters); |
| 33498 | } |
| 33499 | return withJSDoc(finishNode(node_1, pos), hasJSDoc); |
| 33500 | } |
| 33501 | var savedTopLevel = topLevel; |
| 33502 | topLevel = false; |
| 33503 | var modifiers = parseModifiers(); |
| 33504 | var dotDotDotToken = parseOptionalToken(25 /* SyntaxKind.DotDotDotToken */); |
| 33505 | if (!allowAmbiguity && !isParameterNameStart()) { |
| 33506 | return undefined; |
| 33507 | } |
| 33508 | var node = withJSDoc(finishNode(factory.createParameterDeclaration(decorators, modifiers, dotDotDotToken, parseNameOfParameter(modifiers), parseOptionalToken(57 /* SyntaxKind.QuestionToken */), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc); |
| 33509 | topLevel = savedTopLevel; |
| 33510 | return node; |
| 33511 | } |
| 33512 | function parseReturnType(returnToken, isType) { |
| 33513 | if (shouldParseReturnType(returnToken, isType)) { |
| 33514 | return allowConditionalTypesAnd(parseTypeOrTypePredicate); |
no test coverage detected
searching dependent graphs…