Skip to content

Commit

Permalink
fs: Making SyncWriteStream non-enumerable
Browse files Browse the repository at this point in the history
As `SyncWriteStream` is only for internal use, it would be better
if it is non-enumerable, so that a simple `console.log(require('fs'))`
will not reveal it.
  • Loading branch information
thefourtheye committed Jun 11, 2015
1 parent 08f2691 commit 365bc72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,11 @@ util.inherits(SyncWriteStream, Stream);


// Export
fs.SyncWriteStream = SyncWriteStream;

Object.defineProperty(fs, 'SyncWriteStream', {
configurable: true,
writable: true,
value: SyncWriteStream
});

SyncWriteStream.prototype.write = function(data, arg1, arg2) {
var encoding, cb;
Expand Down

0 comments on commit 365bc72

Please sign in to comment.