diff --git a/lib/fs.js b/lib/fs.js index ea7d34295bfd9f..473a7196697e06 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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,