MCPcopy
hub / github.com/requirejs/requirejs / breakCycle

Function breakCycle

require.js:612–638  ·  view source on GitHub ↗
(mod, traced, processed)

Source from the content-addressed store, hash-verified

610 }
611
612 function breakCycle(mod, traced, processed) {
613 var id = mod.map.id;
614
615 if (mod.error) {
616 mod.emit('error', mod.error);
617 } else {
618 traced[id] = true;
619 each(mod.depMaps, function (depMap, i) {
620 var depId = depMap.id,
621 dep = getOwn(registry, depId);
622
623 //Only force things that have not completed
624 //being defined, so still in the registry,
625 //and only if it has not been matched up
626 //in the module already.
627 if (dep && !mod.depMatched[i] && !processed[depId]) {
628 if (getOwn(traced, depId)) {
629 mod.defineDep(i, defined[depId]);
630 mod.check(); //pass false?
631 } else {
632 breakCycle(dep, traced, processed);
633 }
634 }
635 });
636 processed[id] = true;
637 }
638 }
639
640 function checkLoaded() {
641 var err, usingPathFallback,

Callers 1

checkLoadedFunction · 0.85

Calls 2

eachFunction · 0.85
getOwnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…