File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -2812,16 +2812,26 @@ namespace ts {
2812
2812
const parameterType = getTypeOfSymbol(parameterSymbol);
2813
2813
const parameterTypeNode = typeToTypeNodeHelper(parameterType, context);
2814
2814
const name = getDeepSynthesizedClone(parameterDeclaration.name);
2815
+
2816
+ let questionToken: Token<SyntaxKind.QuestionToken> | undefined;
2817
+ let initializer: Expression | undefined;
2818
+ if (isOptionalParameter(parameterDeclaration)) {
2819
+ questionToken = createToken(SyntaxKind.QuestionToken);
2820
+ }
2821
+ else {
2815
2822
// TODO(aozgaa): In the future, check initializer accessibility.
2823
+ initializer = parameterDeclaration.initializer;
2824
+ }
2816
2825
const parameterNode = createParameter(
2817
2826
parameterDeclaration.decorators,
2818
2827
parameterDeclaration.modifiers,
2819
- parameterDeclaration.dotDotDotToken && createToken(SyntaxKind.DotDotDotToken),
2820
- // Clone name to remove trivia.
2828
+ (parameterDeclaration ? isRestParameter(parameterDeclaration) : isTransientSymbol(parameterSymbol) && parameterSymbol.isRestParameter) ?
2829
+ createToken(SyntaxKind.DotDotDotToken) :
2830
+ undefined,
2821
2831
name,
2822
- parameterDeclaration. questionToken && createToken(SyntaxKind.QuestionToken) ,
2832
+ questionToken,
2823
2833
parameterTypeNode,
2824
- parameterDeclaration. initializer);
2834
+ initializer);
2825
2835
return parameterNode;
2826
2836
}
2827
2837
You can’t perform that action at this time.
0 commit comments