mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
net: use asserts in JS Socket Stream to catch races in future
PR-URL: https://github.com/nodejs/node/pull/49400 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
dcf6670783
commit
47add7eb85
1 changed files with 3 additions and 0 deletions
|
@ -149,6 +149,7 @@ class JSStreamSocket extends Socket {
|
|||
}
|
||||
|
||||
const handle = this._handle;
|
||||
assert(handle !== null);
|
||||
|
||||
process.nextTick(() => {
|
||||
// Ensure that write is dispatched asynchronously.
|
||||
|
@ -181,6 +182,8 @@ class JSStreamSocket extends Socket {
|
|||
}
|
||||
|
||||
const handle = this._handle;
|
||||
assert(handle !== null);
|
||||
|
||||
const self = this;
|
||||
|
||||
let pending = bufs.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue