Use self.* in callback to update and close watcher (#97)
onchange callback sets this to the reported FSEvent rather than the outer FSWatcher
This commit is contained in:
Родитель
fcaf11a29c
Коммит
7658ffaaa3
|
@ -1380,10 +1380,10 @@ function FSWatcher() {
|
|||
// after the handle is closed, and to fire both UV_RENAME and UV_CHANGE
|
||||
// if they are set by libuv at the same time.
|
||||
if (status < 0) {
|
||||
if (this._handle !== null) {
|
||||
if (self._handle !== null) {
|
||||
// We don't use this.close() here to avoid firing the close event.
|
||||
this._handle.close();
|
||||
this._handle = null; // make the handle garbage collectable
|
||||
self._handle.close();
|
||||
self._handle = null; // make the handle garbage collectable
|
||||
}
|
||||
const error = errors.uvException({
|
||||
errno: status,
|
||||
|
|
Загрузка…
Ссылка в новой задаче