()
| 477 | } |
| 478 | |
| 479 | function loadSources () { |
| 480 | var sourceHierarchy = self.sources.splice(0); |
| 481 | sourceHierarchy.reverse(); |
| 482 | |
| 483 | // |
| 484 | // If we don't have a callback and the current |
| 485 | // store is capable of loading synchronously |
| 486 | // then do so. |
| 487 | // |
| 488 | if (!callback) { |
| 489 | mergeSources(loadBatch(sourceHierarchy)); |
| 490 | return loadBatch(getStores()); |
| 491 | } |
| 492 | |
| 493 | loadBatch(sourceHierarchy, function (err, data) { |
| 494 | if (err) { |
| 495 | return callback(err); |
| 496 | } |
| 497 | |
| 498 | mergeSources(data); |
| 499 | return loadBatch(getStores(), callback); |
| 500 | }); |
| 501 | } |
| 502 | |
| 503 | return self.sources.length |
| 504 | ? loadSources() |
no test coverage detected
searching dependent graphs…