Skip to content

Commit 6fb96bb

Browse files
committed
fs: remove unneeded return statement
The `writable._write()` implementation does not need to return anything, only call the callback.
1 parent b352e0c commit 6fb96bb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎lib/internal/fs/sync_write_stream.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ObjectSetPrototypeOf(SyncWriteStream, Writable);
2525
SyncWriteStream.prototype._write=function(chunk,encoding,cb){
2626
writeSync(this.fd,chunk,0,chunk.length);
2727
cb();
28-
returntrue;
2928
};
3029

3130
SyncWriteStream.prototype._destroy=function(err,cb){

‎test/parallel/test-internal-fs-syncwritestream.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ const filename = path.join(tmpdir.path, 'sync-write-stream.txt');
3636
conststream=newSyncWriteStream(fd);
3737
constchunk=Buffer.from('foo');
3838

39-
assert.strictEqual(stream._write(chunk,null,common.mustCall(1)),true);
39+
letcalledSynchronously=false;
40+
stream._write(chunk,null,common.mustCall(()=>{
41+
calledSynchronously=true;
42+
},1));
43+
44+
assert.ok(calledSynchronously);
4045
assert.strictEqual(fs.readFileSync(filename).equals(chunk),true);
4146

4247
fs.closeSync(fd);

0 commit comments

Comments
(0)