* Resolve a signature of a given call-like expression. * @param node a call-like expression to try resolve a signature for * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; *
(node, candidatesOutArray, checkMode)
| 76929 | * @return a signature of the call-like expression or undefined if one can't be found |
| 76930 | */ |
| 76931 | function getResolvedSignature(node, candidatesOutArray, checkMode) { |
| 76932 | var links = getNodeLinks(node); |
| 76933 | // If getResolvedSignature has already been called, we will have cached the resolvedSignature. |
| 76934 | // However, it is possible that either candidatesOutArray was not passed in the first time, |
| 76935 | // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work |
| 76936 | // to correctly fill the candidatesOutArray. |
| 76937 | var cached = links.resolvedSignature; |
| 76938 | if (cached && cached !== resolvingSignature && !candidatesOutArray) { |
| 76939 | return cached; |
| 76940 | } |
| 76941 | links.resolvedSignature = resolvingSignature; |
| 76942 | var result = resolveSignature(node, candidatesOutArray, checkMode || 0 /* CheckMode.Normal */); |
| 76943 | // When CheckMode.SkipGenericFunctions is set we use resolvingSignature to indicate that call |
| 76944 | // resolution should be deferred. |
| 76945 | if (result !== resolvingSignature) { |
| 76946 | // If signature resolution originated in control flow type analysis (for example to compute the |
| 76947 | // assigned type in a flow assignment) we don't cache the result as it may be based on temporary |
| 76948 | // types from the control flow analysis. |
| 76949 | links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached; |
| 76950 | } |
| 76951 | return result; |
| 76952 | } |
| 76953 | /** |
| 76954 | * Indicates whether a declaration can be treated as a constructor in a JavaScript |
| 76955 | * file. |
no test coverage detected
searching dependent graphs…