diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 1b29676e00d..52fe3136af5 100755 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -24,6 +24,7 @@ Readable.ReadableState = ReadableState; var EE = require('events').EventEmitter; var Stream = require('stream'); +var Buffer = require('buffer').Buffer; var util = require('util'); var StringDecoder; diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index f02eb4edc1e..f5efe723b42 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -28,6 +28,7 @@ Writable.WritableState = WritableState; var util = require('util'); var Stream = require('stream'); +var Buffer = require('buffer').Buffer; util.inherits(Writable, Stream); diff --git a/lib/assert.js b/lib/assert.js index c9b71d44999..5bd30ea952e 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -24,6 +24,7 @@ // UTILITY var util = require('util'); +var b = require('buffer'); var pSlice = Array.prototype.slice; // 1. The assert module provides functions that throw @@ -144,7 +145,7 @@ function _deepEqual(actual, expected) { if (actual === expected) { return true; - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { + } else if (b.Buffer.isBuffer(actual) && b.Buffer.isBuffer(expected)) { if (actual.length != expected.length) return false; for (var i = 0; i < actual.length; i++) { diff --git a/lib/dgram.js b/lib/dgram.js index e724a619d8c..ea14214535a 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -22,6 +22,7 @@ var assert = require('assert'); var util = require('util'); var events = require('events'); +var Buffer = require('buffer').Buffer; var UDP = process.binding('udp_wrap').UDP; diff --git a/lib/fs.js b/lib/fs.js index 1e3dc6415a6..626f38c1dd1 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -31,6 +31,7 @@ var pathModule = require('path'); var binding = process.binding('fs'); var constants = process.binding('constants'); var fs = exports; +var Buffer = require('buffer').Buffer; var Stream = require('stream').Stream; var EventEmitter = require('events').EventEmitter; diff --git a/lib/http.js b/lib/http.js index f87df173b31..6f640d1af37 100644 --- a/lib/http.js +++ b/lib/http.js @@ -24,6 +24,7 @@ var net = require('net'); var Stream = require('stream'); var timers = require('timers'); var url = require('url'); +var Buffer = require('buffer').Buffer; var EventEmitter = require('events').EventEmitter; var FreeList = require('freelist').FreeList; var HTTPParser = process.binding('http_parser').HTTPParser; diff --git a/lib/net.js b/lib/net.js index bc336934b1d..402e0909bc6 100644 --- a/lib/net.js +++ b/lib/net.js @@ -25,6 +25,7 @@ var timers = require('timers'); var util = require('util'); var assert = require('assert'); var cares = process.binding('cares_wrap'); +var Buffer = require('buffer').Buffer; var cluster; function noop() {} diff --git a/lib/readline.js b/lib/readline.js index c52f3e88b21..d64661622e1 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -29,6 +29,7 @@ var kHistorySize = 30; var kBufSize = 10 * 1024; var util = require('util'); +var Buffer = require('buffer').Buffer; var inherits = require('util').inherits; var EventEmitter = require('events').EventEmitter; diff --git a/lib/tls.js b/lib/tls.js index 77a7089218b..e3b90832236 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -26,6 +26,7 @@ var url = require('url'); var events = require('events'); var stream = require('stream'); var assert = require('assert').ok; +var Buffer = require('buffer').Buffer; var constants = require('constants'); var Timer = process.binding('timer_wrap').Timer; diff --git a/lib/zlib.js b/lib/zlib.js index c72ab92dcda..0004f9da4ba 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -23,6 +23,7 @@ var Transform = require('_stream_transform'); var binding = process.binding('zlib'); var util = require('util'); +var Buffer = require('buffer').Buffer; var assert = require('assert').ok; // zlib doesn't provide these, so kludge them in following the same