Skip to content

Commit

Permalink
fs: refactor deprecated functions for readability
Browse files Browse the repository at this point in the history
This is a small refactor to make an object more readable (IMO).

Yeah, I spent a bit longer looking at the code and misunderstanding it
than I care to admit right now.

PR-URL: nodejs#12910
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and Olivier Martin committed May 19, 2017
1 parent 834da12 commit f4ff299
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2140,10 +2140,8 @@ WriteStream.prototype.destroySoon = WriteStream.prototype.end;
var SyncWriteStream = internalFS.SyncWriteStream;
Object.defineProperty(fs, 'SyncWriteStream', {
configurable: true,
get: internalUtil.deprecate(() => {
return SyncWriteStream;
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061'),
set: internalUtil.deprecate((val) => {
SyncWriteStream = val;
}, 'fs.SyncWriteStream is deprecated.', 'DEP0061')
get: internalUtil.deprecate(() => SyncWriteStream,
'fs.SyncWriteStream is deprecated.', 'DEP0061'),
set: internalUtil.deprecate((val) => { SyncWriteStream = val; },
'fs.SyncWriteStream is deprecated.', 'DEP0061')
});

0 comments on commit f4ff299

Please sign in to comment.