(list)
| 660 | |
| 661 | |
| 662 | function fixBufferList(list) { |
| 663 | const newlist = new Array(list.length); |
| 664 | |
| 665 | for (let i = 0, l = list.length; i < l; i++) { |
| 666 | const buf = list[i]; |
| 667 | if (typeof buf === 'string') |
| 668 | newlist[i] = Buffer.from(buf); |
| 669 | else if (Buffer.isBuffer(buf)) |
| 670 | newlist[i] = buf; |
| 671 | else if (!isArrayBufferView(buf)) |
| 672 | return null; |
| 673 | else |
| 674 | newlist[i] = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); |
| 675 | } |
| 676 | |
| 677 | return newlist; |
| 678 | } |
| 679 | |
| 680 | |
| 681 | function enqueue(self, toEnqueue) { |