Skip to content

Commit

Permalink
Work around a Node.js bug
Browse files Browse the repository at this point in the history
  • Loading branch information
awwright committed Oct 1, 2019
1 parent 8838c06 commit 3f6fcb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function makeDuplexPair() {
}
clientSide._write = function _write(chunk, enc, callback){
if(serverCallback) throw new Error;
if(!chunk.length) return void callback();
if(typeof callback==='function') serverCallback = callback;
serverSide.push(chunk);
}
Expand All @@ -39,6 +40,7 @@ function makeDuplexPair() {
}
serverSide._write = function _write(chunk, enc, callback){
if(clientCallback) throw new Error;
if(!chunk.length) return void callback();
if(typeof callback==='function') clientCallback = callback;
clientSide.push(chunk);
}
Expand Down

0 comments on commit 3f6fcb1

Please sign in to comment.