MCPcopy Create free account
hub / github.com/nodejs/node / getCanonicalOverload

Function getCanonicalOverload

test/fixtures/snapshot/typescript.js:80921–80929  ·  view source on GitHub ↗
(overloads, implementation)

Source from the content-addressed store, hash-verified

80919 }
80920 function checkFunctionOrConstructorSymbolWorker(symbol) {
80921 function getCanonicalOverload(overloads, implementation) {
80922 // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration
80923 // Error on all deviations from this canonical set of flags
80924 // The caveat is that if some overloads are defined in lib.d.ts, we don't want to
80925 // report the errors on those. To achieve this, we will say that the implementation is
80926 // the canonical signature only if it is in the same container as the first overload
80927 var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent;
80928 return implementationSharesContainerWithFirstOverload ? implementation : overloads[0];
80929 }
80930 function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) {
80931 // Error if some overloads have a flag that is not shared by all overloads. To find the
80932 // deviations, we XOR someOverloadFlags with allOverloadFlags

Calls

no outgoing calls

Tested by

no test coverage detected