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

Function assignBindingElementTypes

test/fixtures/snapshot/typescript.js:77758–77771  ·  view source on GitHub ↗
(pattern, parentType)

Source from the content-addressed store, hash-verified

77756 // When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
77757 // the destructured type into the contained binding elements.
77758 function assignBindingElementTypes(pattern, parentType) {
77759 for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
77760 var element = _a[_i];
77761 if (!ts.isOmittedExpression(element)) {
77762 var type = getBindingElementTypeFromParentType(element, parentType);
77763 if (element.name.kind === 79 /* SyntaxKind.Identifier */) {
77764 getSymbolLinks(getSymbolOfNode(element)).type = type;
77765 }
77766 else {
77767 assignBindingElementTypes(element.name, type);
77768 }
77769 }
77770 }
77771 }
77772 function createPromiseType(promisedType) {
77773 // creates a `Promise<T>` type where `T` is the promisedType argument
77774 var globalPromiseType = getGlobalPromiseType(/*reportErrors*/ true);

Callers 1

assignParameterTypeFunction · 0.85

Calls 3

getSymbolLinksFunction · 0.85
getSymbolOfNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…