Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/internal/streams/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,11 @@ ObjectDefineProperties(Readable.prototype, {
readableAborted: {
enumerable: false,
get: function() {
return !!(this._readableState.destroyed || this._readableState.errored) &&
!this._readableState.endEmitted;
return !!(
this._readableState.readable !== false &&
(this._readableState.destroyed || this._readableState.errored) &&
!this._readableState.endEmitted
);
}
},

Expand Down
11 changes: 10 additions & 1 deletion test/parallel/test-stream-readable-aborted.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const common = require('../common');
const assert = require('assert');
const { Readable } = require('stream');
const { Readable, Duplex } = require('stream');

{
const readable = new Readable({
Expand Down Expand Up @@ -55,3 +55,12 @@ const { Readable } = require('stream');
}));
readable.resume();
}

{
const duplex = new Duplex({
readable: false,
write() {}
});
duplex.destroy();
assert.strictEqual(duplex.readableAborted, false);
}