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 — lib: allow respondWithNewView on byob auto allocated streams · nodejs/node@ec5b594

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/webstreams
    • readablestream.js
  • test/parallel
    • test-whatwg-readablebytestream.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/webstreams/readablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/readablestream.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2604,6 +2604,7 @@ function readableByteStreamControllerPullSteps(controller, readRequest) {
26042604
pendingPullIntos,
26052605
{
26062606
buffer,
2607+
bufferByteLength: autoAllocateChunkSize,
26072608
byteOffset: 0,
26082609
byteLength: autoAllocateChunkSize,
26092610
bytesFilled: 0,
Collapse file

‎test/parallel/test-whatwg-readablebytestream.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-whatwg-readablebytestream.js
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,33 @@ class Source {
232232
code: 'ERR_INVALID_STATE',
233233
});
234234
}
235+
236+
{
237+
const stream = new ReadableStream({
238+
type: 'bytes',
239+
pull(c) {
240+
const v = new Uint8Array(c.byobRequest.view.buffer, 0, 3);
241+
v.set([20, 21, 22]);
242+
c.byobRequest.respondWithNewView(v);
243+
},
244+
});
245+
const buffer = new ArrayBuffer(10);
246+
const view = new Uint8Array(buffer, 0, 3);
247+
view.set([10, 11, 12]);
248+
const reader = stream.getReader({ mode: 'byob' });
249+
reader.read(view);
250+
}
251+
252+
{
253+
const stream = new ReadableStream({
254+
type: 'bytes',
255+
autoAllocateChunkSize: 10,
256+
pull(c) {
257+
const v = new Uint8Array(c.byobRequest.view.buffer, 0, 3);
258+
v.set([20, 21, 22]);
259+
c.byobRequest.respondWithNewView(v);
260+
},
261+
});
262+
const reader = stream.getReader();
263+
reader.read();
264+
}

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.