mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
f8b9831338
Remove all leftover usage of _stream_* and keep all of them as legacy. We do not deprecate the old modules to avoid disrupition and ease maintainance. PR-URL: https://github.com/nodejs/node/pull/36684 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
28 lines
485 B
JavaScript
28 lines
485 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const { Readable } = require('stream');
|
|
const EE = require('events').EventEmitter;
|
|
|
|
const oldStream = new EE();
|
|
oldStream.pause = () => {};
|
|
oldStream.resume = () => {};
|
|
|
|
{
|
|
new Readable({
|
|
autoDestroy: false,
|
|
destroy: common.mustCall()
|
|
})
|
|
.wrap(oldStream);
|
|
oldStream.emit('destroy');
|
|
}
|
|
|
|
{
|
|
new Readable({
|
|
autoDestroy: false,
|
|
destroy: common.mustCall()
|
|
})
|
|
.wrap(oldStream);
|
|
oldStream.emit('close');
|
|
}
|