diff options
author | James M Snell <jasnell@gmail.com> | 2016-05-02 10:27:12 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-05-17 11:05:18 -0700 |
commit | dcccbfdc799d174901c29d82874457367231fec5 (patch) | |
tree | bb1a45d053b169af0b1662000d57e034e4422996 /test/parallel/test-fs-open-flags.js | |
parent | f856234ffaa10441545c3b6ce420b247a17c06cf (diff) | |
download | android-node-v8-dcccbfdc799d174901c29d82874457367231fec5.tar.gz android-node-v8-dcccbfdc799d174901c29d82874457367231fec5.tar.bz2 android-node-v8-dcccbfdc799d174901c29d82874457367231fec5.zip |
src: refactor require('constants')
The require('constants') module is currently undocumented and mashes
together unrelated constants. This refactors the require('constants')
in favor of distinct os.constants, fs.constants, and crypto.constants
that are specific to the modules for which they are relevant. The
next step is to document those within the specific modules.
PR-URL: https://github.com/nodejs/node/pull/6534
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-open-flags.js')
-rw-r--r-- | test/parallel/test-fs-open-flags.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index cf451b4f8d..d212130bc9 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -2,16 +2,15 @@ require('../common'); var assert = require('assert'); -var constants = require('constants'); var fs = require('fs'); -var O_APPEND = constants.O_APPEND || 0; -var O_CREAT = constants.O_CREAT || 0; -var O_EXCL = constants.O_EXCL || 0; -var O_RDONLY = constants.O_RDONLY || 0; -var O_RDWR = constants.O_RDWR || 0; -var O_TRUNC = constants.O_TRUNC || 0; -var O_WRONLY = constants.O_WRONLY || 0; +var O_APPEND = fs.constants.O_APPEND || 0; +var O_CREAT = fs.constants.O_CREAT || 0; +var O_EXCL = fs.constants.O_EXCL || 0; +var O_RDONLY = fs.constants.O_RDONLY || 0; +var O_RDWR = fs.constants.O_RDWR || 0; +var O_TRUNC = fs.constants.O_TRUNC || 0; +var O_WRONLY = fs.constants.O_WRONLY || 0; assert.equal(fs._stringToFlags('r'), O_RDONLY); assert.equal(fs._stringToFlags('r+'), O_RDWR); |