Skip to content

Commit

Permalink
net: use asserts in JS Socket Stream to catch races in future
Browse files Browse the repository at this point in the history
PR-URL: nodejs/node#49400
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent c17ac8b commit be0f17c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graal-nodejs/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

0 comments on commit be0f17c

Please sign in to comment.