Skip to content

Commit b7d9941

Browse files
committed
lib: fix lib/internal/blob.js Blob.stream() for nodejs#48668 nodejs#48916
Add lacked calling resolve() for finish ReadableStream source.pull(). Fixes: nodejs#48668 Fixes: nodejs#48916 Fixes: nodejs#48232 Refs: 8cc1438
1 parent e8dcf79 commit b7d9941

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/internal/blob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ class Blob {
361361
if (c.desiredSize <= 0) {
362362
// A manual backpressure check.
363363
if (this.pendingPulls.length !== 0) {
364-
// case of waiting pull finished (= not yet canceled)
364+
// A case of waiting pull finished (= not yet canceled)
365365
const pending = this.pendingPulls.shift();
366366
pending.resolve();
367367
}

test/parallel/test-blob.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,16 @@ assert.throws(() => new Blob({}), {
270270
})().then(common.mustCall());
271271

272272
(async () => {
273-
const b = new Blob(["A", "B", "C"]);
273+
const b = new Blob(['A', 'B', 'C']);
274274
const stream = b.stream();
275275
const chunks = [];
276276
const decoder = new TextDecoder();
277277
await stream.pipeTo(new WritableStream({
278278
write(chunk) {
279-
chunks.push(decoder.decode(chunk, {stream: true}));
279+
chunks.push(decoder.decode(chunk, { stream: true }));
280280
}
281281
}));
282-
assert.strictEqual(chunks.join(""), "ABC");
282+
assert.strictEqual(chunks.join(''), 'ABC');
283283
})().then(common.mustCall());
284284

285285
(async () => {

0 commit comments

Comments
 (0)