Files
node/doc/api
Joyee Cheung 6c25f2ea49 fs: improve errors thrown from fs.watch()
- Add an accessor property `initialized `to FSEventWrap to
  check the state of the handle from the JS land
- Introduce ERR_FS_WATCHER_ALREADY_STARTED so calling start()
  on a watcher that is already started will throw instead of
  doing nothing silently.
- Introduce ERR_FS_WATCHER_NOT_STARTED so calling close()
  on a watcher that is already closed will throw instead of
  doing nothing silently.
- Validate the filename passed to fs.watch()
- Assert that the handle in the watcher are instances of
  FSEvent instead of relying on the illegal invocation error
  from the VM.
- Add more assertions in FSEventWrap methods now that we check
  `initialized` and the filename in JS land before invoking
  the binding.
- Use uvException instead of errornoException to create
  the errors with the error numbers from libuv to make them
  consistent with other errors in fs.

TODO:

- Improve fs.watchFile() the same way this patch improves fs.watch()
- It seems possible to fire both rename and change event from libuv
  together now that we can check if the handle is closed via
  `initialized` in JS land.

PR-URL: https://github.com/nodejs/node/pull/19089
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-08 01:14:53 +08:00
..
2018-02-23 16:26:29 +00:00
2018-03-06 00:46:30 +09:00
2018-02-23 16:26:29 +00:00
2018-02-23 16:26:29 +00:00
2018-02-23 16:26:29 +00:00
2018-03-06 00:46:30 +09:00
2018-03-06 00:46:30 +09:00
2018-03-06 00:46:30 +09:00
2018-02-23 16:26:29 +00:00
2018-02-26 16:46:55 +02:00
2018-02-23 16:26:29 +00:00
2018-02-23 16:26:29 +00:00
2016-04-20 16:34:27 -07:00
2018-03-07 12:04:16 -05:00
2018-02-23 16:26:29 +00:00
2018-02-26 18:27:29 +02:00
2018-03-06 07:50:01 -08:00
2018-02-26 18:27:29 +02:00
2018-02-08 11:57:14 -05:00
2018-03-01 20:47:02 +11:00
2018-02-23 16:26:29 +00:00
2018-03-06 00:46:30 +09:00
2018-02-01 02:52:31 +02:00
2018-03-04 12:47:55 +01:00
2018-02-23 16:26:29 +00:00
2018-02-23 16:26:29 +00:00
2018-03-06 00:46:30 +09:00