From 6f449db60fa9507e241402b92afa550cc508acf5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 8 May 2017 17:02:28 -0700 Subject: [PATCH] fs: refactor deprecated functions for readability 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: https://github.com/nodejs/node/pull/12910 Reviewed-By: Yuta Hiroto Reviewed-By: Gibson Fahnestock Reviewed-By: James M Snell --- lib/fs.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/fs.js b/lib/fs.js index f159fc4bacfdad..2137fe35310a20 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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') });