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:
Simionescu, Radu 2018-07-11 11:38:52 +01:00 committed by Ruben Bridgewater
parent 7b6e2fc114
commit 7e4e04d22f
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -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);