MCPcopy Create free account
hub / github.com/JsAaron/jQuery / breakCycle

Function breakCycle

迷你jQuery/basis/Require.js:598–624  ·  view source on GitHub ↗
(mod, traced, processed)

Source from the content-addressed store, hash-verified

596 }
597
598 function breakCycle(mod, traced, processed) {
599 var id = mod.map.id;
600
601 if (mod.error) {
602 mod.emit('error', mod.error);
603 } else {
604 traced[id] = true;
605 each(mod.depMaps, function (depMap, i) {
606 var depId = depMap.id,
607 dep = getOwn(registry, depId);
608
609 //Only force things that have not completed
610 //being defined, so still in the registry,
611 //and only if it has not been matched up
612 //in the module already.
613 if (dep && !mod.depMatched[i] && !processed[depId]) {
614 if (getOwn(traced, depId)) {
615 mod.defineDep(i, defined[depId]);
616 mod.check(); //pass false?
617 } else {
618 breakCycle(dep, traced, processed);
619 }
620 }
621 });
622 processed[id] = true;
623 }
624 }
625
626 function checkLoaded() {
627 var err, usingPathFallback,

Callers 1

checkLoadedFunction · 0.85

Calls 2

getOwnFunction · 0.85
eachFunction · 0.70

Tested by

no test coverage detected