diff --git a/lib/fs.js b/lib/fs.js index 816fbde0d2565f..30d2261215eedd 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1894,15 +1894,14 @@ WriteStream.prototype._write = function(data, encoding, cb) { this._write(data, encoding, cb); }); - var self = this; - fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) { + fs.write(this.fd, data, 0, data.length, this.pos, (er, bytes) => { if (er) { - if (self.autoClose) { - self.destroy(); + if (this.autoClose) { + this.destroy(); } return cb(er); } - self.bytesWritten += bytes; + this.bytesWritten += bytes; cb(); });