MCPcopy Index your code
hub / github.com/nodejs/node / transformConstructorParameters

Function transformConstructorParameters

test/fixtures/snapshot/typescript.js:99088–99096  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

addConstructorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected