Fix --watch handling of deleted sources #3275
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
--watch
)EPERM
errors from watchers (see also below)removeSource
watcher
at scope starterr
for errors and exceptionsSuppressing
EPERM
If a watched directory gets deleted its
fs.FSWatcher
throwsEPERM
(not to be confused withEACCESS
). The same happens for the watchers of contained files andfs.unlink
. We have to fix it on our end because it will not be fixed in node (see nodejs/node-v0.x-archive#4337).This PR simply suppresses the error. I also refrained from adding
if process.platform is 'win32'
tests. All other causes ofEPERM
should break the actual compilation, i.e. when reading and writing files.