stream: named anonymous functions in _stream_readable.js
PR-URL: https://github.com/nodejs/node/pull/21750 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
7b6e2fc114
commit
7e4e04d22f
@ -721,7 +721,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
|
||||
};
|
||||
|
||||
function pipeOnDrain(src) {
|
||||
return function() {
|
||||
return function pipeOnDrainFunctionResult() {
|
||||
var state = src._readableState;
|
||||
debug('pipeOnDrain', state.awaitDrain);
|
||||
if (state.awaitDrain)
|
||||
@ -951,8 +951,8 @@ Readable.prototype.wrap = function(stream) {
|
||||
// important when wrapping filters and duplexes.
|
||||
for (var i in stream) {
|
||||
if (this[i] === undefined && typeof stream[i] === 'function') {
|
||||
this[i] = function(method) {
|
||||
return function() {
|
||||
this[i] = function methodWrap(method) {
|
||||
return function methodWrapReturnFunction() {
|
||||
return stream[method].apply(stream, arguments);
|
||||
};
|
||||
}(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user