Skip to content

Commit 7a8aa8a

Browse files
committed
quic: fix weakly weakup assignment
1 parent ae53ee7 commit 7a8aa8a

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

lib/internal/blob.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,16 +476,14 @@ function createBlobReaderStream(reader) {
476476
// Lazily register a wakeup callback that the C++ side can invoke
477477
// when new data is available after a STATUS_BLOCK.
478478
let immediate;
479-
reader.setWakeup(() => {
480-
if (this.pendingPulls.length > 0 &&
481-
typeof immediate === 'undefined') {
482-
// Postpone the execution to the next steps of the event loop
483-
immediate = setImmediate(() => {
479+
this.wakeup = () => {
480+
if (this.pendingPulls.length > 0) {
481+
immediate ??= setImmediate(() => {
484482
immediate = undefined;
485483
this.readNext(c);
486484
});
487485
}
488-
});
486+
};
489487
},
490488
pull(c) {
491489
const { promise, resolve, reject } = PromiseWithResolvers();

0 commit comments

Comments
 (0)