Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
21 lines
509 B
JavaScript
21 lines
509 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const stream = require('stream');
|
|
const Buffer = require('buffer').Buffer;
|
|
|
|
const r = new stream.Readable();
|
|
r._read = function(size) {
|
|
r.push(Buffer.allocUnsafe(size));
|
|
};
|
|
|
|
const w = new stream.Writable();
|
|
w._write = function(data, encoding, cb) {
|
|
cb(null);
|
|
};
|
|
|
|
r.pipe(w);
|
|
|
|
// This might sound unrealistic, but it happens in net.js. When
|
|
// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which
|
|
// ends the writable side of net.Socket.
|
|
w.end();
|