MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / fetchAll

Function fetchAll

lib/web/tern/tern.js:324–342  ·  view source on GitHub ↗
(srv, c)

Source from the content-addressed store, hash-verified

322 }
323
324 function fetchAll(srv, c) {
325 var done = true, returned = false;
326 srv.files.forEach(function(file) {
327 if (file.text != null) return;
328 if (srv.options.async) {
329 done = false;
330 srv.options.getFile(file.name, function(err, text) {
331 if (err && !returned) { returned = true; return c(err); }
332 updateText(file, text || "", srv);
333 fetchAll(srv, c);
334 });
335 } else {
336 try {
337 updateText(file, srv.options.getFile(file.name) || "", srv);
338 } catch (e) { return c(e); }
339 }
340 });
341 if (done) c();
342 }
343
344 function waitOnFetch(srv, timeBudget, c) {
345 var done = function() {

Callers

nothing calls this directly

Calls 4

updateTextFunction · 0.85
getFileMethod · 0.80
cFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected