| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ddebd29 commit 69b7f91
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -444,7 +444,7 @@ Reads data from the file and stores that in the given buffer. | |||
| 444 | 444 | If the file is not modified concurrently, the end-of-file is reached when the | |
| 445 | 445 | number of bytes read is zero. | |
| 446 | 446 | ||
| 447 | - #### `filehandle.readableWebStream(options)` | ||
| 447 | + #### `filehandle.readableWebStream([options])` | ||
| 448 | 448 | ||
| 449 | 449 | <!-- YAML | |
| 450 | 450 | added: v17.0.0 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -276,17 +276,8 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { | |||
| 276 | 276 | this[kHandle], | |
| 277 | 277 | undefined, | |
| 278 | 278 | { ondone: () => this[kUnref]() }); | |
| 279 | - | ||
| 280 | - const { | ||
| 281 | - readableStreamCancel, | ||
| 282 | - } = require('internal/webstreams/readablestream'); | ||
| 283 | - this[kRef](); | ||
| 284 | - this.once('close', () => { | ||
| 285 | - readableStreamCancel(readable); | ||
| 286 | - }); | ||
| 287 | 279 | } else { | |
| 288 | 280 | const { | |
| 289 | - readableStreamCancel, | ||
| 290 | 281 | ReadableStream, | |
| 291 | 282 | } = require('internal/webstreams/readablestream'); | |
| 292 | 283 | ||
@@ -313,14 +304,16 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { | |||
| 313 | 304 | ondone(); | |
| 314 | 305 | }, | |
| 315 | 306 | }); | |
| 316 | - | ||
| 317 | - this[kRef](); | ||
| 318 | - | ||
| 319 | - this.once('close', () => { | ||
| 320 | - readableStreamCancel(readable); | ||
| 321 | - }); | ||
| 322 | 307 | } | |
| 323 | 308 | ||
| 309 | + const { | ||
| 310 | + readableStreamCancel, | ||
| 311 | + } = require('internal/webstreams/readablestream'); | ||
| 312 | + this[kRef](); | ||
| 313 | + this.once('close', () => { | ||
| 314 | + readableStreamCancel(readable); | ||
| 315 | + }); | ||
| 316 | + | ||
| 324 | 317 | return readable; | |
| 325 | 318 | } | |
| 326 | 319 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments