From fcfd07e9fd8b333437cf9689b17ebab1fbea291f Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Wed, 3 Jun 2015 20:27:44 +0530 Subject: [PATCH] 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. --- lib/fs.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index 7d45c33e2711a4..2e84e31c4cbba1 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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;