(node, isDerivedClass)
| 99095 | || []; |
| 99096 | } |
| 99097 | function createDefaultConstructorBody(node, isDerivedClass) { |
| 99098 | // We must be here because the user didn't write a constructor |
| 99099 | // but we needed to call 'super(...args)' anyway as per 14.5.14 of the ES2016 spec. |
| 99100 | // If that's the case we can just immediately return the result of a 'super()' call. |
| 99101 | var statements = []; |
| 99102 | resumeLexicalEnvironment(); |
| 99103 | factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); |
| 99104 | if (isDerivedClass) { |
| 99105 | // return _super !== null && _super.apply(this, arguments) || this; |
| 99106 | statements.push(factory.createReturnStatement(createDefaultSuperCallOrThis())); |
| 99107 | } |
| 99108 | var statementsArray = factory.createNodeArray(statements); |
| 99109 | ts.setTextRange(statementsArray, node.members); |
| 99110 | var block = factory.createBlock(statementsArray, /*multiLine*/ true); |
| 99111 | ts.setTextRange(block, node); |
| 99112 | ts.setEmitFlags(block, 1536 /* EmitFlags.NoComments */); |
| 99113 | return block; |
| 99114 | } |
| 99115 | /** |
| 99116 | * Transforms the body of a constructor declaration of a class. |
| 99117 | * |
no test coverage detected
searching dependent graphs…