| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3ae96ae commit c3a27d1
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,6 @@ ObjectSetPrototypeOf(SyncWriteStream, Writable); | |||
| 25 | 25 | SyncWriteStream.prototype._write = function(chunk, encoding, cb) { | |
| 26 | 26 | writeSync(this.fd, chunk, 0, chunk.length); | |
| 27 | 27 | cb(); | |
| 28 | - return true; | ||
| 29 | 28 | }; | |
| 30 | 29 | ||
| 31 | 30 | SyncWriteStream.prototype._destroy = function(err, cb) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,12 @@ const filename = path.join(tmpdir.path, 'sync-write-stream.txt'); | |||
| 36 | 36 | const stream = new SyncWriteStream(fd); | |
| 37 | 37 | const chunk = Buffer.from('foo'); | |
| 38 | 38 | ||
| 39 | - assert.strictEqual(stream._write(chunk, null, common.mustCall(1)), true); | ||
| 39 | + let calledSynchronously = false; | ||
| 40 | + stream._write(chunk, null, common.mustCall(() => { | ||
| 41 | + calledSynchronously = true; | ||
| 42 | + }, 1)); | ||
| 43 | + | ||
| 44 | + assert.ok(calledSynchronously); | ||
| 40 | 45 | assert.strictEqual(fs.readFileSync(filename).equals(chunk), true); | |
| 41 | 46 | ||
| 42 | 47 | fs.closeSync(fd); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments