mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
fs: avoid using forEach
PR-URL: https://github.com/nodejs/node/pull/11582 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
80949f3d88
commit
d0fb578d64
1 file changed
+5
-4
@@ -200,10 +200,11 @@ fs.Stats.prototype.isSocket = function() {
|
||||
};
|
||||
|
||||
// Don't allow mode to accidentally be overwritten.
|
||||
['F_OK', 'R_OK', 'W_OK', 'X_OK'].forEach(function(key) {
|
||||
Object.defineProperty(fs, key, {
|
||||
enumerable: true, value: constants[key] || 0, writable: false
|
||||
});
|
||||
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},
|
||||
X_OK: {enumerable: true, value: constants.X_OK || 0},
|
||||
});
|
||||
|
||||
function handleError(val, callback) {
|
||||
|
||||
Reference in new issue
Block a user