(file, dep)
| 102 | }); |
| 103 | |
| 104 | function watchFile (file, dep) { |
| 105 | dep = dep || file; |
| 106 | if (ignored) { |
| 107 | if (!ignoredFiles.hasOwnProperty(file)) { |
| 108 | ignoredFiles[file] = anymatch(ignored, file); |
| 109 | } |
| 110 | if (ignoredFiles[file]) return; |
| 111 | } |
| 112 | if (!fwatchers[file]) fwatchers[file] = []; |
| 113 | if (!fwatcherFiles[file]) fwatcherFiles[file] = []; |
| 114 | if (fwatcherFiles[file].indexOf(dep) >= 0) return; |
| 115 | |
| 116 | var w = b._watcher(dep, wopts); |
| 117 | w.setMaxListeners(0); |
| 118 | w.on('error', b.emit.bind(b, 'error')); |
| 119 | w.on('change', function () { |
| 120 | invalidate(file); |
| 121 | }); |
| 122 | fwatchers[file].push(w); |
| 123 | fwatcherFiles[file].push(dep); |
| 124 | } |
| 125 | |
| 126 | function invalidate (id) { |
| 127 | if (cache) delete cache[id]; |
no test coverage detected