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 5, 2015
1 parent 85c76a0 commit 32d9610
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 32d9610

Please sign in to comment.