summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-02-19 17:09:41 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-02-27 20:34:02 +0800
commit437c75649335a0b412670b82d3dfc37be7b01d0b (patch)
tree212c8ee5af23b6968745f93b90550deeaef8662f /lib/fs.js
parente8ec898a7d8169bed73378b5cd4e677adbec16c8 (diff)
downloadandroid-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.tar.gz
android-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.tar.bz2
android-node-v8-437c75649335a0b412670b82d3dfc37be7b01d0b.zip
fs: throw fs.chmodSync errors in JS land
PR-URL: https://github.com/nodejs/node/pull/18871 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'lib/fs.js')
-rw-r--r--lib/fs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 60134b1c32..0d8d8ec4dc 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -1054,7 +1054,9 @@ fs.chmodSync = function(path, mode) {
validatePath(path);
mode = modeNum(mode);
validateUint32(mode, 'mode');
- return binding.chmod(pathModule.toNamespacedPath(path), mode);
+ const ctx = { path };
+ binding.chmod(pathModule.toNamespacedPath(path), mode, undefined, ctx);
+ handleErrorFromBinding(ctx);
};
if (constants.O_SYMLINK !== undefined) {