Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-28 06:54:31 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-07-28 06:54:31 +0400
commit8527f00c3c2beca11fe0c25048920ec50d177c28 (patch)
treee20b638bc2dec81a76a26fe936e4540ed2a84a60 /lib
parentea9ee1fb7e3f785c21d04a155e0f18a354fe0173 (diff)
Lazy load a few modules
Diffstat (limited to 'lib')
-rw-r--r--lib/buffer.js9
-rw-r--r--lib/tty_posix.js5
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index f31d69e85c6..e48dfada8f1 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -20,7 +20,6 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var SlowBuffer = process.binding('buffer').SlowBuffer;
-var IEEE754 = require('buffer_ieee754');
var assert = require('assert');
@@ -741,7 +740,7 @@ Buffer.prototype.readFloat = function(offset, endian) {
assert.ok(offset + 3 < buffer.length,
'Trying to read beyond buffer length');
- return IEEE754.readIEEE754(buffer, offset, endian, 23, 4);
+ return require('buffer_ieee754').readIEEE754(buffer, offset, endian, 23, 4);
};
Buffer.prototype.readDouble = function(offset, endian) {
@@ -759,7 +758,7 @@ Buffer.prototype.readDouble = function(offset, endian) {
assert.ok(offset + 7 < buffer.length,
'Trying to read beyond buffer length');
- return IEEE754.readIEEE754(buffer, offset, endian, 52, 8);
+ return require('buffer_ieee754').readIEEE754(buffer, offset, endian, 52, 8);
};
@@ -1035,7 +1034,7 @@ Buffer.prototype.writeFloat = function(value, offset, endian) {
'Trying to write beyond buffer length');
verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38);
- IEEE754.writeIEEE754(buffer, value, offset, endian, 23, 4);
+ require('buffer_ieee754').writeIEEE754(buffer, value, offset, endian, 23, 4);
};
@@ -1058,6 +1057,6 @@ Buffer.prototype.writeDouble = function(value, offset, endian) {
'Trying to write beyond buffer length');
verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308);
- IEEE754.writeIEEE754(buffer, value, offset, endian, 52, 8);
+ require('buffer_ieee754').writeIEEE754(buffer, value, offset, endian, 52, 8);
};
diff --git a/lib/tty_posix.js b/lib/tty_posix.js
index 6b12204169c..66afe14cd0e 100644
--- a/lib/tty_posix.js
+++ b/lib/tty_posix.js
@@ -22,8 +22,7 @@
var binding = process.binding('stdio'),
net = require('net_legacy'), // FIXME
- inherits = require('util').inherits,
- spawn = require('child_process').spawn;
+ inherits = require('util').inherits;
exports.open = function(path, args) {
@@ -42,7 +41,7 @@ exports.open = function(path, args) {
stream.resume();
- child = spawn(path, args, {
+ child = require('child_process').spawn(path, args, {
env: env,
customFds: [masterFD, masterFD, masterFD],
setsid: true