jashkenas/coffee-script — pull request #3275 by marchaefner (2013-12-04 21:34:54+00:00)
Title: Fix --watch handling of deleted sources

* Fixes #3267 (Source maps don't get deleted when using `--watch`)
* Suppress `EPERM` errors from watchers (see also below)
* Minor readability improvements
- Remove unnecessary parameter of `removeSource`
- Explicitly declare `watcher` at scope start
- Consistent use of `err` for errors and exceptions

#### Suppressing `EPERM`

If a watched directory gets deleted its `fs.FSWatcher` throws `EPERM` (not to be confused with `EACCESS`). The same happens for the watchers of contained files and `fs.unlink`. We have to fix it on our end because it will not be fixed in node (see joyent/node#4337).

This PR simply suppresses the error. I also refrained from adding `if process.platform is 'win32'` tests. All other causes of `EPERM` should break the actual compilation, i.e. when reading and writing files.