Skip to content

Commit 365bc72

Browse files
committed
fs: Making SyncWriteStream non-enumerable
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.
1 parent 08f2691 commit 365bc72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/fs.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1878,8 +1878,11 @@ util.inherits(SyncWriteStream, Stream);
18781878

18791879

18801880
// Export
1881-
fs.SyncWriteStream = SyncWriteStream;
1882-
1881+
Object.defineProperty(fs, 'SyncWriteStream', {
1882+
configurable: true,
1883+
writable: true,
1884+
value: SyncWriteStream
1885+
});
18831886

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

0 commit comments

Comments
 (0)