Skip to content

Commit 86eda17

Browse files
committed
fs: define constants with const
Define fs constants using const, as the newer version of v8 supports it, and appears to be capable of optimizing. PR-URL: #522 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent b33cd4f commit 86eda17

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

lib/fs.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ var FSReqWrap = binding.FSReqWrap;
1616
var Readable = Stream.Readable;
1717
var Writable = Stream.Writable;
1818

19-
var kMinPoolSpace = 128;
20-
var kMaxLength = require('smalloc').kMaxLength;
21-
22-
var O_APPEND = constants.O_APPEND || 0;
23-
var O_CREAT = constants.O_CREAT || 0;
24-
var O_EXCL = constants.O_EXCL || 0;
25-
var O_RDONLY = constants.O_RDONLY || 0;
26-
var O_RDWR = constants.O_RDWR || 0;
27-
var O_SYNC = constants.O_SYNC || 0;
28-
var O_TRUNC = constants.O_TRUNC || 0;
29-
var O_WRONLY = constants.O_WRONLY || 0;
30-
var F_OK = constants.F_OK || 0;
31-
var R_OK = constants.R_OK || 0;
32-
var W_OK = constants.W_OK || 0;
33-
var X_OK = constants.X_OK || 0;
19+
const kMinPoolSpace = 128;
20+
const kMaxLength = require('smalloc').kMaxLength;
21+
22+
const O_APPEND = constants.O_APPEND || 0;
23+
const O_CREAT = constants.O_CREAT || 0;
24+
const O_EXCL = constants.O_EXCL || 0;
25+
const O_RDONLY = constants.O_RDONLY || 0;
26+
const O_RDWR = constants.O_RDWR || 0;
27+
const O_SYNC = constants.O_SYNC || 0;
28+
const O_TRUNC = constants.O_TRUNC || 0;
29+
const O_WRONLY = constants.O_WRONLY || 0;
30+
const F_OK = constants.F_OK || 0;
31+
const R_OK = constants.R_OK || 0;
32+
const W_OK = constants.W_OK || 0;
33+
const X_OK = constants.X_OK || 0;
3434

3535
var isWindows = process.platform === 'win32';
3636

0 commit comments

Comments
 (0)