* Transforms the parameters of the constructor declaration of a class. * * @param constructor The constructor for the class. * @param hasSynthesizedSuper A value indicating whether the constructor starts with a * synthesized `super` call
(constructor, hasSynthesizedSuper)
| 99086 | * synthesized `super` call. |
| 99087 | */ |
| 99088 | function transformConstructorParameters(constructor, hasSynthesizedSuper) { |
| 99089 | // If the TypeScript transformer needed to synthesize a constructor for property |
| 99090 | // initializers, it would have also added a synthetic `...args` parameter and |
| 99091 | // `super` call. |
| 99092 | // If this is the case, we do not include the synthetic `...args` parameter and |
| 99093 | // will instead use the `arguments` object in ES5/3. |
| 99094 | return ts.visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : undefined, visitor, context) |
| 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. |