Lazy load a few modules
This commit is contained in:
parent
ea9ee1fb7e
commit
8527f00c3c
@ -20,7 +20,6 @@
|
|||||||
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
var SlowBuffer = process.binding('buffer').SlowBuffer;
|
var SlowBuffer = process.binding('buffer').SlowBuffer;
|
||||||
var IEEE754 = require('buffer_ieee754');
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
|
|
||||||
|
|
||||||
@ -741,7 +740,7 @@ Buffer.prototype.readFloat = function(offset, endian) {
|
|||||||
assert.ok(offset + 3 < buffer.length,
|
assert.ok(offset + 3 < buffer.length,
|
||||||
'Trying to read beyond 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) {
|
Buffer.prototype.readDouble = function(offset, endian) {
|
||||||
@ -759,7 +758,7 @@ Buffer.prototype.readDouble = function(offset, endian) {
|
|||||||
assert.ok(offset + 7 < buffer.length,
|
assert.ok(offset + 7 < buffer.length,
|
||||||
'Trying to read beyond 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');
|
'Trying to write beyond buffer length');
|
||||||
|
|
||||||
verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38);
|
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');
|
'Trying to write beyond buffer length');
|
||||||
|
|
||||||
verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308);
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
var binding = process.binding('stdio'),
|
var binding = process.binding('stdio'),
|
||||||
net = require('net_legacy'), // FIXME
|
net = require('net_legacy'), // FIXME
|
||||||
inherits = require('util').inherits,
|
inherits = require('util').inherits;
|
||||||
spawn = require('child_process').spawn;
|
|
||||||
|
|
||||||
|
|
||||||
exports.open = function(path, args) {
|
exports.open = function(path, args) {
|
||||||
@ -42,7 +41,7 @@ exports.open = function(path, args) {
|
|||||||
stream.resume();
|
stream.resume();
|
||||||
|
|
||||||
|
|
||||||
child = spawn(path, args, {
|
child = require('child_process').spawn(path, args, {
|
||||||
env: env,
|
env: env,
|
||||||
customFds: [masterFD, masterFD, masterFD],
|
customFds: [masterFD, masterFD, masterFD],
|
||||||
setsid: true
|
setsid: true
|
||||||
|
@ -41,7 +41,6 @@ var expected = [
|
|||||||
'NativeModule events',
|
'NativeModule events',
|
||||||
'NativeModule buffer',
|
'NativeModule buffer',
|
||||||
'Binding buffer',
|
'Binding buffer',
|
||||||
'NativeModule buffer_ieee754', // FIXME should not be loading
|
|
||||||
'NativeModule assert',
|
'NativeModule assert',
|
||||||
'NativeModule util',
|
'NativeModule util',
|
||||||
'Binding stdio',
|
'Binding stdio',
|
||||||
@ -70,8 +69,6 @@ expected = expected.concat([
|
|||||||
'Binding io_watcher',
|
'Binding io_watcher',
|
||||||
'NativeModule tty',
|
'NativeModule tty',
|
||||||
'NativeModule tty_posix', // FIXME branch on win32 here.
|
'NativeModule tty_posix', // FIXME branch on win32 here.
|
||||||
'NativeModule child_process', // FIXME should not be loading
|
|
||||||
'Binding child_process' // FIXME should not be loading
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
checkExpected();
|
checkExpected();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user