We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80949f3 commit d0fb578Copy full SHA for d0fb578
lib/fs.js
@@ -200,10 +200,11 @@ fs.Stats.prototype.isSocket = function() {
200
};
201
202
// Don't allow mode to accidentally be overwritten.
203
-['F_OK', 'R_OK', 'W_OK', 'X_OK'].forEach(function(key) {
204
- Object.defineProperty(fs, key, {
205
- enumerable: true, value: constants[key] || 0, writable: false
206
- });
+Object.defineProperties(fs, {
+ F_OK: {enumerable: true, value: constants.F_OK || 0},
+ R_OK: {enumerable: true, value: constants.R_OK || 0},
+ W_OK: {enumerable: true, value: constants.W_OK || 0},
207
+ X_OK: {enumerable: true, value: constants.X_OK || 0},
208
});
209
210
function handleError(val, callback) {
0 commit comments