summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJackson Tian <puling.tyq@alibaba-inc.com>2015-01-19 17:52:07 +0800
committerTrevor Norris <trev.norris@gmail.com>2015-02-11 16:49:22 -0700
commit4823afcbe26dd3a23aaa35d552a9656f37c8645d (patch)
treec2c3a9cda32b07cea8fc0f81cfa87280f8e8b609 /test
parentd2b546187a86c3fc45f1b0e9336ca72ac30256e4 (diff)
downloadnode-4823afcbe26dd3a23aaa35d552a9656f37c8645d.tar.gz
fs: make F_OK/R_OK/W_OK/X_OK not writable
Change the fs.F_OK/R_OK/W_OK/X_OK out of fs.js will lead unexpect exception. Make these properties readonly. PR-URL: https://github.com/joyent/node/pull/9060 [trev.norris@gmail.com test properties are read only] Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/simple/test-fs-access.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/simple/test-fs-access.js b/test/simple/test-fs-access.js
index 83af67b9a..4bc1028dc 100644
--- a/test/simple/test-fs-access.js
+++ b/test/simple/test-fs-access.js
@@ -77,6 +77,13 @@ if (process.platform !== 'win32' && process.getuid() === 0) {
}
}
+// Check that {F,R,W,X}_OK are read only
+
+fs.F_OK = null;
+fs.R_OK = null;
+fs.W_OK = null;
+fs.X_OK = null;
+
assert(typeof fs.F_OK === 'number');
assert(typeof fs.R_OK === 'number');
assert(typeof fs.W_OK === 'number');