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 — stream: don't push null from closed promise #42694 · nodejs/node@c514751

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/webstreams
    • adapters.js
  • test/parallel
    • test-readable-from-web-enqueue-then-close.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/webstreams/adapters.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/adapters.js
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const {
3232
const {
3333
isDestroyed,
3434
isReadable,
35-
isReadableEnded,
3635
isWritable,
3736
isWritableEnded,
3837
} = require('internal/streams/utils');
@@ -528,8 +527,6 @@ function newStreamReadableFromReadableStream(readableStream, options = kEmptyObj
528527
reader.closed,
529528
() => {
530529
closed = true;
531-
if (!isReadableEnded(readable))
532-
readable.push(null);
533530
},
534531
(error) => {
535532
closed = true;
@@ -794,8 +791,6 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options =
794791
reader.closed,
795792
() => {
796793
readableClosed = true;
797-
if (!isReadableEnded(duplex))
798-
duplex.push(null);
799794
},
800795
(error) => {
801796
writableClosed = true;
Collapse file

‎test/parallel/test-readable-from-web-enqueue-then-close.js‎

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'use strict';
2+
const { mustCall } = require('../common');
3+
const { Readable, Duplex } = require('stream');
4+
const { strictEqual } = require('assert');
5+
6+
function start(controller) {
7+
controller.enqueue(new Uint8Array(1));
8+
controller.close();
9+
}
10+
11+
Readable.fromWeb(new ReadableStream({ start }))
12+
.on('data', mustCall((d) => {
13+
strictEqual(d.length, 1);
14+
}))
15+
.on('end', mustCall())
16+
.resume();
17+
18+
Duplex.fromWeb({
19+
readable: new ReadableStream({ start }),
20+
writable: new WritableStream({ write(chunk) {} })
21+
})
22+
.on('data', mustCall((d) => {
23+
strictEqual(d.length, 1);
24+
}))
25+
.on('end', mustCall())
26+
.resume();

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.