Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
net: use asserts in JS Socket Stream to catch races in future
  • Loading branch information
pimterry committed Aug 29, 2023
commit fb9611bd5d2940ac0ab2c835a4c10d07ebd7b99e
3 changes: 3 additions & 0 deletions lib/internal/js_stream_socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class JSStreamSocket extends Socket {
}

const handle = this._handle;
assert(handle !== null);

process.nextTick(() => {
// Ensure that write is dispatched asynchronously.
Expand Down Expand Up @@ -181,6 +182,8 @@ class JSStreamSocket extends Socket {
}

const handle = this._handle;
assert(handle !== null);

const self = this;

let pending = bufs.length;
Expand Down