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 <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
sercher committed Apr 25, 2024
1 parent 641fa5a commit 53f9f75
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 53f9f75

Please sign in to comment.