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