GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "stream: noop pause/resume on destroyed streams" · nodejs/node@3f54c8b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams
    • readable.js
  • test/parallel
    • test-stream-destroy.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/streams/readable.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/readable.js
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,6 @@ function nReadingNextTick(self) {
12331233
// If the user uses them, then switch into old mode.
12341234
Readable.prototype.resume = function() {
12351235
const state = this._readableState;
1236-
if ((state[kState] & kDestroyed) !== 0) {
1237-
return this;
1238-
}
12391236
if ((state[kState] & kFlowing) === 0) {
12401237
debug('resume');
12411238
// We flow only if there is no one listening
@@ -1276,9 +1273,6 @@ function resume_(stream, state) {
12761273

12771274
Readable.prototype.pause = function() {
12781275
const state = this._readableState;
1279-
if ((state[kState] & kDestroyed) !== 0) {
1280-
return this;
1281-
}
12821276
debug('call pause');
12831277
if ((state[kState] & (kHasFlowing | kFlowing)) !== kHasFlowing) {
12841278
debug('pause');
Collapse file

‎test/parallel/test-stream-destroy.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-stream-destroy.js
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,3 @@ const http = require('http');
118118
req.end('asd');
119119
}));
120120
}
121-
122-
{
123-
// resume() and pause() should be no-ops on destroyed streams.
124-
const r = new Readable({ read() {} });
125-
r.destroy();
126-
r.on('resume', common.mustNotCall());
127-
r.on('pause', common.mustNotCall());
128-
r.resume();
129-
r.pause();
130-
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.