mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
7a7ba82234
PR-URL: https://github.com/nodejs/node/pull/39332 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
22 lines
404 B
JavaScript
22 lines
404 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const { Writable } = require('stream');
|
|
|
|
{
|
|
const w = new Writable({
|
|
write(chunk, encoding, callback) {
|
|
callback(null);
|
|
},
|
|
final(callback) {
|
|
queueMicrotask(callback);
|
|
}
|
|
});
|
|
w.end();
|
|
w.destroy();
|
|
|
|
w.on('prefinish', common.mustNotCall());
|
|
w.on('finish', common.mustNotCall());
|
|
w.on('close', common.mustCall());
|
|
}
|