| 154572 | return undefined; |
| 154573 | } |
| 154574 | function getVariableLikeInitializer(declaration) { |
| 154575 | switch (declaration.kind) { |
| 154576 | case 254 /* SyntaxKind.VariableDeclaration */: |
| 154577 | case 164 /* SyntaxKind.Parameter */: |
| 154578 | case 203 /* SyntaxKind.BindingElement */: |
| 154579 | case 167 /* SyntaxKind.PropertyDeclaration */: |
| 154580 | case 296 /* SyntaxKind.PropertyAssignment */: |
| 154581 | return declaration.initializer; |
| 154582 | case 285 /* SyntaxKind.JsxAttribute */: |
| 154583 | return declaration.initializer && (ts.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : undefined); |
| 154584 | case 297 /* SyntaxKind.ShorthandPropertyAssignment */: |
| 154585 | case 166 /* SyntaxKind.PropertySignature */: |
| 154586 | case 299 /* SyntaxKind.EnumMember */: |
| 154587 | case 347 /* SyntaxKind.JSDocPropertyTag */: |
| 154588 | case 340 /* SyntaxKind.JSDocParameterTag */: |
| 154589 | return undefined; |
| 154590 | } |
| 154591 | } |
| 154592 | function addReturnStatement(changes, sourceFile, expression, statement) { |
| 154593 | ts.suppressLeadingAndTrailingTrivia(expression); |
| 154594 | var probablyNeedSemi = ts.probablyUsesSemicolons(sourceFile); |