| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 25ba7f4 commit cc9712d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,7 +116,7 @@ class FileHandle { | |||
| 116 | 116 | return writeFile(this, data, options); | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | - close() { | ||
| 119 | + close = () => { | ||
| 120 | 120 | return this[kHandle].close(); | |
| 121 | 121 | } | |
| 122 | 122 | } | |
@@ -411,7 +411,7 @@ async function lchmod(path, mode) { | |||
| 411 | 411 | throw new ERR_METHOD_NOT_IMPLEMENTED('lchmod()'); | |
| 412 | 412 | ||
| 413 | 413 | const fd = await open(path, O_WRONLY | O_SYMLINK); | |
| 414 | - return fchmod(fd, mode).finally(fd.close.bind(fd)); | ||
| 414 | + return fchmod(fd, mode).finally(fd.close); | ||
| 415 | 415 | } | |
| 416 | 416 | ||
| 417 | 417 | async function lchown(path, uid, gid) { | |
@@ -476,7 +476,7 @@ async function writeFile(path, data, options) { | |||
| 476 | 476 | return writeFileHandle(path, data, options); | |
| 477 | 477 | ||
| 478 | 478 | const fd = await open(path, flag, options.mode); | |
| 479 | - return writeFileHandle(fd, data, options).finally(fd.close.bind(fd)); | ||
| 479 | + return writeFileHandle(fd, data, options).finally(fd.close); | ||
| 480 | 480 | } | |
| 481 | 481 | ||
| 482 | 482 | async function appendFile(path, data, options) { | |
@@ -494,7 +494,7 @@ async function readFile(path, options) { | |||
| 494 | 494 | return readFileHandle(path, options); | |
| 495 | 495 | ||
| 496 | 496 | const fd = await open(path, flag, 0o666); | |
| 497 | - return readFileHandle(fd, options).finally(fd.close.bind(fd)); | ||
| 497 | + return readFileHandle(fd, options).finally(fd.close); | ||
| 498 | 498 | } | |
| 499 | 499 | ||
| 500 | 500 | module.exports = { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -372,7 +372,7 @@ WriteStream.prototype.close = function(cb) { | |||
| 372 | 372 | // If we are not autoClosing, we should call | |
| 373 | 373 | // destroy on 'finish'. | |
| 374 | 374 | if (!this.autoClose) { | |
| 375 | - this.on('finish', this.destroy.bind(this)); | ||
| 375 | + this.on('finish', this.destroy); | ||
| 376 | 376 | } | |
| 377 | 377 | ||
| 378 | 378 | // We use end() instead of destroy() because of | |
| Back | FazBrowse Home | New Git URL |
0 commit comments