From 4fd4838c12ff1eb2c863f52dd95bbd6c93a89e3b Mon Sep 17 00:00:00 2001 From: Vladimir Kurchatkin Date: Fri, 5 Jun 2015 10:37:11 +0300 Subject: [PATCH] fs: use `kMaxLength` from binding This allows `graceful-fs` to evaluate `fs` source without access to internals. This is a temporary workaround that makes npm work. See: https://github.com/isaacs/node-graceful-fs/issues/41 Fixes: https://github.com/nodejs/io.js/issues/1898 --- lib/fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index 72251d0b7537f4..08b101625faf53 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -19,7 +19,7 @@ const Readable = Stream.Readable; const Writable = Stream.Writable; const kMinPoolSpace = 128; -const kMaxLength = require('internal/smalloc').kMaxLength; +const kMaxLength = process.binding('smalloc').kMaxLength; const O_APPEND = constants.O_APPEND || 0; const O_CREAT = constants.O_CREAT || 0;