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

Function invokeOnce

test/fixtures/snapshot/typescript.js:68683–68715  ·  view source on GitHub ↗
(source, target, action)

Source from the content-addressed store, hash-verified

68681 priority = savePriority;
68682 }
68683 function invokeOnce(source, target, action) {
68684 var key = source.id + "," + target.id;
68685 var status = visited && visited.get(key);
68686 if (status !== undefined) {
68687 inferencePriority = Math.min(inferencePriority, status);
68688 return;
68689 }
68690 (visited || (visited = new ts.Map())).set(key, -1 /* InferencePriority.Circularity */);
68691 var saveInferencePriority = inferencePriority;
68692 inferencePriority = 2048 /* InferencePriority.MaxValue */;
68693 // We stop inferring and report a circularity if we encounter duplicate recursion identities on both
68694 // the source side and the target side.
68695 var saveExpandingFlags = expandingFlags;
68696 var sourceIdentity = getRecursionIdentity(source);
68697 var targetIdentity = getRecursionIdentity(target);
68698 if (ts.contains(sourceStack, sourceIdentity))
68699 expandingFlags |= 1 /* ExpandingFlags.Source */;
68700 if (ts.contains(targetStack, targetIdentity))
68701 expandingFlags |= 2 /* ExpandingFlags.Target */;
68702 if (expandingFlags !== 3 /* ExpandingFlags.Both */) {
68703 (sourceStack || (sourceStack = [])).push(sourceIdentity);
68704 (targetStack || (targetStack = [])).push(targetIdentity);
68705 action(source, target);
68706 targetStack.pop();
68707 sourceStack.pop();
68708 }
68709 else {
68710 inferencePriority = -1 /* InferencePriority.Circularity */;
68711 }
68712 expandingFlags = saveExpandingFlags;
68713 visited.set(key, inferencePriority);
68714 inferencePriority = Math.min(inferencePriority, saveInferencePriority);
68715 }
68716 function inferFromMatchingTypes(sources, targets, matches) {
68717 var matchedSources;
68718 var matchedTargets;

Callers 1

inferFromTypesFunction · 0.85

Calls 8

getRecursionIdentityFunction · 0.85
actionFunction · 0.85
popMethod · 0.80
getMethod · 0.65
minMethod · 0.45
setMethod · 0.45
containsMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…