From: Vladimir Kurchatkin Date: Fri, 5 Jun 2015 07:37:11 +0000 (+0300) Subject: fs: use `kMaxLength` from binding X-Git-Tag: v2.3.0~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2dcef83b5fce615cc486ab10692a6925cba037ca;p=platform%2Fupstream%2Fnodejs.git 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 PR-URL: https://github.com/nodejs/io.js/pull/1903 Reviewed-By: Ben Noordhuis --- diff --git a/lib/fs.js b/lib/fs.js index 72251d0..08b1016 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;