diff --git a/lib/internal/js_stream_socket.js b/lib/internal/js_stream_socket.js index 68e1802a63b012..70d6d03069f3f1 100644 --- a/lib/internal/js_stream_socket.js +++ b/lib/internal/js_stream_socket.js @@ -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;