From 08809f28ad797b914bad2dcd21eefba898eaaa4d Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 25 Apr 2017 10:03:47 -0700 Subject: [PATCH] fs: simplify constant decls PR-URL: https://github.com/nodejs/node/pull/12644 Reviewed-By: Brian White --- lib/internal/fs.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/internal/fs.js b/lib/internal/fs.js index 97a4c16aed1..e7a7299b344 100644 --- a/lib/internal/fs.js +++ b/lib/internal/fs.js @@ -4,16 +4,17 @@ const Buffer = require('buffer').Buffer; const Writable = require('stream').Writable; const fs = require('fs'); const util = require('util'); -const constants = process.binding('constants').fs; -const O_APPEND = constants.O_APPEND | 0; -const O_CREAT = constants.O_CREAT | 0; -const O_EXCL = constants.O_EXCL | 0; -const O_RDONLY = constants.O_RDONLY | 0; -const O_RDWR = constants.O_RDWR | 0; -const O_SYNC = constants.O_SYNC | 0; -const O_TRUNC = constants.O_TRUNC | 0; -const O_WRONLY = constants.O_WRONLY | 0; +const { + O_APPEND, + O_CREAT, + O_EXCL, + O_RDONLY, + O_RDWR, + O_SYNC, + O_TRUNC, + O_WRONLY +} = process.binding('constants').fs; function assertEncoding(encoding) { if (encoding && !Buffer.isEncoding(encoding)) {