diff options
Diffstat (limited to 'deps/npm/node_modules/readable-stream/lib/internal/streams')
-rw-r--r-- | deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js | 13 | ||||
-rw-r--r-- | deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js | 10 |
2 files changed, 15 insertions, 8 deletions
diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js index d467615978..aefc68bd90 100644 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -1,11 +1,9 @@ 'use strict'; -/*<replacement>*/ - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = require('safe-buffer').Buffer; -/*</replacement>*/ +var util = require('util'); function copyBuffer(src, target, offset) { src.copy(target, offset); @@ -71,4 +69,11 @@ module.exports = function () { }; return BufferList; -}();
\ No newline at end of file +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +}
\ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js index b3e58c33bc..5a0a0d88ce 100644 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js +++ b/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -2,7 +2,7 @@ /*<replacement>*/ -var processNextTick = require('process-nextick-args'); +var pna = require('process-nextick-args'); /*</replacement>*/ // undocumented cb() API, needed for core, not for public API @@ -16,9 +16,9 @@ function destroy(err, cb) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - processNextTick(emitErrorNT, this, err); + pna.nextTick(emitErrorNT, this, err); } - return; + return this; } // we set destroyed to true before firing error callbacks in order @@ -35,7 +35,7 @@ function destroy(err, cb) { this._destroy(err || null, function (err) { if (!cb && err) { - processNextTick(emitErrorNT, _this, err); + pna.nextTick(emitErrorNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } @@ -43,6 +43,8 @@ function destroy(err, cb) { cb(err); } }); + + return this; } function undestroy() { |