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 — fs: remove redundant code in readableWebStream() · nodejs/node@69b7f91

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • fs.md
  • lib/internal/fs
    • promises.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Reads data from the file and stores that in the given buffer.
444444
If the file is not modified concurrently, the end-of-file is reached when the
445445
number of bytes read is zero.
446446
447-
#### `filehandle.readableWebStream(options)`
447+
#### `filehandle.readableWebStream([options])`
448448
449449
<!-- YAML
450450
added: v17.0.0
Collapse file

‎lib/internal/fs/promises.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/promises.js
+8-15Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -276,17 +276,8 @@ class FileHandle extends EventEmitterMixin(JSTransferable) {
276276
this[kHandle],
277277
undefined,
278278
{ ondone: () => this[kUnref]() });
279-
280-
const {
281-
readableStreamCancel,
282-
} = require('internal/webstreams/readablestream');
283-
this[kRef]();
284-
this.once('close', () => {
285-
readableStreamCancel(readable);
286-
});
287279
} else {
288280
const {
289-
readableStreamCancel,
290281
ReadableStream,
291282
} = require('internal/webstreams/readablestream');
292283

@@ -313,14 +304,16 @@ class FileHandle extends EventEmitterMixin(JSTransferable) {
313304
ondone();
314305
},
315306
});
316-
317-
this[kRef]();
318-
319-
this.once('close', () => {
320-
readableStreamCancel(readable);
321-
});
322307
}
323308

309+
const {
310+
readableStreamCancel,
311+
} = require('internal/webstreams/readablestream');
312+
this[kRef]();
313+
this.once('close', () => {
314+
readableStreamCancel(readable);
315+
});
316+
324317
return readable;
325318
}
326319

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.