(srv, name, parent, text)
| 295 | } |
| 296 | |
| 297 | function ensureFile(srv, name, parent, text) { |
| 298 | var known = srv.findFile(name); |
| 299 | if (known) { |
| 300 | if (text != null) { |
| 301 | if (known.scope) { |
| 302 | srv.needsPurge.push(name); |
| 303 | infer.clearScopes(known.ast); |
| 304 | known.scope = null; |
| 305 | } |
| 306 | updateText(known, text, srv); |
| 307 | } |
| 308 | if (parentDepth(srv, known.parent) > parentDepth(srv, parent)) { |
| 309 | known.parent = parent; |
| 310 | if (known.excluded) known.excluded = null; |
| 311 | } |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | var file = new File(name, parent); |
| 316 | srv.files.push(file); |
| 317 | srv.fileMap[name] = file; |
| 318 | if (text != null) { |
| 319 | updateText(file, text, srv); |
| 320 | } else if (srv.options.async) { |
| 321 | srv.startAsyncAction(); |
| 322 | srv.options.getFile(name, function(err, text) { |
| 323 | updateText(file, text || "", srv); |
| 324 | srv.finishAsyncAction(err); |
| 325 | }); |
| 326 | } else { |
| 327 | updateText(file, srv.options.getFile(name) || "", srv); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | function fetchAll(srv, c) { |
| 332 | var done = true, returned = false; |
no test coverage detected
searching dependent graphs…