Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix: use self instead of this inside FSWatcher onchange callback #97

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down