| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ const spawnWithReadable = () => { | |||
| 27 | 27 | })); | |
| 28 | 28 | p.stdout.on('readable', () => { | |
| 29 | 29 | let buf; | |
| 30 | - while (buf = p.stdout.read()) | ||
| 30 | + while ((buf = p.stdout.read()) !== null) | ||
| 31 | 31 | buffer.push(buf); | |
| 32 | 32 | }); | |
| 33 | 33 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ function makeConnection(index) { | |||
| 68 | 68 | if (closes === N / 2) { | |
| 69 | 69 | let cb; | |
| 70 | 70 | console.error('calling wait callback.'); | |
| 71 | - while (cb = waits.shift()) { | ||
| 71 | + while ((cb = waits.shift()) !== undefined) { | ||
| 72 | 72 | cb(); | |
| 73 | 73 | } | |
| 74 | 74 | server.close(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,7 @@ const BATCH = 10; | |||
| 47 | 47 | readable.on('readable', () => { | |
| 48 | 48 | let data; | |
| 49 | 49 | console.log('readable emitted'); | |
| 50 | - while (data = readable.read()) { | ||
| 50 | + while ((data = readable.read()) !== null) { | ||
| 51 | 51 | console.log(data); | |
| 52 | 52 | } | |
| 53 | 53 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ let readAll = false; | |||
| 41 | 41 | const seen = []; | |
| 42 | 42 | r.on('readable', () => { | |
| 43 | 43 | let chunk; | |
| 44 | - while (chunk = r.read()) { | ||
| 44 | + while ((chunk = r.read()) !== null) { | ||
| 45 | 45 | seen.push(chunk.toString()); | |
| 46 | 46 | // Simulate only reading a certain amount of the data, | |
| 47 | 47 | // and then putting the rest of the chunk back into the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ deflater.write(chunk, function() { | |||
| 16 | 16 | deflater.flush(function() { | |
| 17 | 17 | const bufs = []; | |
| 18 | 18 | let buf; | |
| 19 | - while (buf = deflater.read()) | ||
| 19 | + while ((buf = deflater.read()) !== null) | ||
| 20 | 20 | bufs.push(buf); | |
| 21 | 21 | actualFull = Buffer.concat(bufs); | |
| 22 | 22 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ deflater.write(chunk, function() { | |||
| 23 | 23 | deflater.flush(function() { | |
| 24 | 24 | const bufs = []; | |
| 25 | 25 | let buf; | |
| 26 | - while (buf = deflater.read()) | ||
| 26 | + while ((buf = deflater.read()) !== null) | ||
| 27 | 27 | bufs.push(buf); | |
| 28 | 28 | actualFull = Buffer.concat(bufs); | |
| 29 | 29 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ deflater.write(chunk1, function() { | |||
| 21 | 21 | deflater.end(chunk2, function() { | |
| 22 | 22 | const bufs = []; | |
| 23 | 23 | let buf; | |
| 24 | - while (buf = deflater.read()) | ||
| 24 | + while ((buf = deflater.read()) !== null) | ||
| 25 | 25 | bufs.push(buf); | |
| 26 | 26 | actual = Buffer.concat(bufs); | |
| 27 | 27 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments