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

Function instantiateSignature

test/fixtures/snapshot/typescript.js:63350–63372  ·  view source on GitHub ↗
(signature, mapper, eraseTypeParameters)

Source from the content-addressed store, hash-verified

63348 return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper));
63349 }
63350 function instantiateSignature(signature, mapper, eraseTypeParameters) {
63351 var freshTypeParameters;
63352 if (signature.typeParameters && !eraseTypeParameters) {
63353 // First create a fresh set of type parameters, then include a mapping from the old to the
63354 // new type parameters in the mapper function. Finally store this mapper in the new type
63355 // parameters such that we can use it when instantiating constraints.
63356 freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter);
63357 mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper);
63358 for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) {
63359 var tp = freshTypeParameters_1[_i];
63360 tp.mapper = mapper;
63361 }
63362 }
63363 // Don't compute resolvedReturnType and resolvedTypePredicate now,
63364 // because using `mapper` now could trigger inferences to become fixed. (See `createInferenceContext`.)
63365 // See GH#17600.
63366 var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol),
63367 /*resolvedReturnType*/ undefined,
63368 /*resolvedTypePredicate*/ undefined, signature.minArgumentCount, signature.flags & 39 /* SignatureFlags.PropagatingFlags */);
63369 result.target = signature;
63370 result.mapper = mapper;
63371 return result;
63372 }
63373 function instantiateSymbol(symbol, mapper) {
63374 var links = getSymbolLinks(symbol);
63375 if (links.type && !couldContainTypeVariables(links.type)) {

Calls 6

combineTypeMappersFunction · 0.85
createTypeMapperFunction · 0.85
createSignatureFunction · 0.85
instantiateSymbolFunction · 0.85
instantiateListFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected