You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1e0f331 introduced an issue where the end event isn't emitted.
The following test case can reproduce it:
'use strict'conststream=require('stream')classReadableArrayextendsstream.Readable{constructor(data){super({objectMode: true})this._data=data}_read(size){if(this._data.length===0)returnthis.push(null);this.push(this._data.shift());}}classPassThroughAsWrapperextendsstream.Readable{constructor(readable){super({objectMode: true})this._readable=readablethis._readable.once('end',()=>this.push(null))}_read(size){constdata=this._readable.read()if(data===null){this._readable.once('readable',()=>{constdata=this._readable.read()// this reads null, but somehow the end event is not emittedif(data!==null)returnthis.push(data)// end event handler will call .push()})}else{returnthis.push(data)}}}constinputData=[{},{}]constreadable=newReadableArray(inputData)letendEvent=falseconstresult=newPassThroughAsWrapper(readable.pipe(newstream.PassThrough({objectMode: true})))result.once('end',function(){endEvent=true;console.log('end event');})result.resume()process.on('exit',function(){if(!endEvent)console.log('no end event')})
The expected result is end event the actual result is no end event.
1e0f331 introduced an issue where the
end
event isn't emitted.The following test case can reproduce it:
The expected result is
end event
the actual result isno end event
./cc @mcollina @mafintosh
The text was updated successfully, but these errors were encountered: