MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / visit

Function visit

Support/SingleFileLibs/javascript/amalgamationCore.js:196–216  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

194 const order = [];
195
196 function visit(name) {
197 if (!dependencies || !dependencies[name]) {
198 const chain = [...visiting, name].join(' -> ');
199 throw new Error(`Unknown library dependency '${name}' while resolving ${chain}`);
200 }
201 if (visiting.includes(name)) {
202 const cycleStart = visiting.indexOf(name);
203 const cycle = [...visiting.slice(cycleStart), name].join(' -> ');
204 throw new Error(`Dependency cycle detected: ${cycle}`);
205 }
206 if (visited.has(name)) return;
207
208 visiting.push(name);
209 for (const dependency of dependencies[name].direct_dependencies || []) {
210 visit(dependency);
211 }
212 visiting.pop();
213
214 visited.add(name);
215 order.push(name);
216 }
217
218 visit(libraryName);
219

Callers 15

validateDependencyOrderFunction · 0.70
~TaggedUnionMethod · 0.50
TaggedUnionMethod · 0.50
SC::TaggedUnionClass · 0.50
setTypeMethod · 0.50
assignMethod · 0.50
visitMethod · 0.50
visitMethod · 0.50
visitMethod · 0.50
buildMethod · 0.50
visitMethod · 0.50
buildMethod · 0.50

Calls 4

popMethod · 0.80
joinMethod · 0.45
pushMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected