stream: do not use _stream_* anymore

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>
This commit is contained in:
Matteo Collina 2020-12-29 15:20:41 +01:00
parent db79783bad
commit f8b9831338
22 changed files with 40 additions and 40 deletions

View File

@ -1,6 +1,5 @@
'use strict';
// TODO(mcollina): deprecate this file
// Keep this file as an alias for the full stream module.
const Duplex = require('internal/streams/duplex');
module.exports = Duplex;
module.exports = require('stream').Duplex;

View File

@ -1,6 +1,5 @@
'use strict';
// TODO(mcollina): deprecate this file
// Keep this file as an alias for the full stream module.
const PassThrough = require('internal/streams/passthrough');
module.exports = PassThrough;
module.exports = require('stream').PassThrough;

View File

@ -1,6 +1,5 @@
'use strict';
// TODO(mcollina): deprecate this file
// Keep this file as an alias for the full stream module.
const Readable = require('internal/streams/readable');
module.exports = Readable;
module.exports = require('stream').Readable;

View File

@ -1,6 +1,5 @@
'use strict';
// TODO(mcollina): deprecate this file
// Keep this file as an alias for the full stream module.
const Transform = require('internal/streams/transform');
module.exports = Transform;
module.exports = require('stream').Transform;

View File

@ -1,6 +1,5 @@
'use strict';
// TODO(mcollina): deprecate this file
// Keep this file as an alias for the full stream module.
const Writable = require('internal/streams/writable');
module.exports = Writable;
module.exports = require('stream').Writable;

View File

@ -0,0 +1,14 @@
'use strict';
require('../common');
const assert = require('assert');
const stream = require('stream');
// Verify that all individual aliases are left in place.
assert.strictEqual(stream.Readable, require('_stream_readable'));
assert.strictEqual(stream.Writable, require('_stream_writable'));
assert.strictEqual(stream.Duplex, require('_stream_duplex'));
assert.strictEqual(stream.Transform, require('_stream_transform'));
assert.strictEqual(stream.PassThrough, require('_stream_passthrough'));

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const Readable = require('_stream_readable');
const Writable = require('_stream_writable');
const { Readable, Writable } = require('stream');
class TestReadable extends Readable {
constructor(opt) {

View File

@ -2,8 +2,7 @@
const common = require('../common');
const assert = require('assert');
const Readable = require('_stream_readable');
const Writable = require('_stream_writable');
const { Readable, Writable } = require('stream');
// Pipe should pause temporarily if writable needs drain.
{

View File

@ -21,8 +21,7 @@
'use strict';
require('../common');
const R = require('_stream_readable');
const W = require('_stream_writable');
const { Readable: R, Writable: W } = require('stream');
const assert = require('assert');
const src = new R({ encoding: 'base64' });

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const R = require('_stream_readable');
const W = require('_stream_writable');
const { Readable: R, Writable: W } = require('stream');
const assert = require('assert');
const EE = require('events').EventEmitter;

View File

@ -21,8 +21,7 @@
'use strict';
require('../common');
const R = require('_stream_readable');
const W = require('_stream_writable');
const { Readable: R, Writable: W } = require('stream');
const assert = require('assert');
let ondataCalled = 0;

View File

@ -1,6 +1,6 @@
'use strict';
require('../common');
const Readable = require('_stream_readable');
const { Readable } = require('stream');
const assert = require('assert');
let buf = '';

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const Readable = require('_stream_readable');
const Writable = require('_stream_writable');
const { Readable, Writable } = require('stream');
const assert = require('assert');
function toArray(callback) {

View File

@ -23,7 +23,7 @@
'use strict';
require('../common');
const assert = require('assert');
const fromList = require('_stream_readable')._fromList;
const fromList = require('stream').Readable._fromList;
const BufferList = require('internal/streams/buffer_list');
const util = require('util');

View File

@ -22,7 +22,7 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const Readable = require('_stream_readable');
const { Readable } = require('stream');
let len = 0;
const chunks = new Array(10);

View File

@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
const Readable = require('_stream_readable');
const { Readable } = require('stream');
const EE = require('events').EventEmitter;
const oldStream = new EE();

View File

@ -22,7 +22,7 @@
'use strict';
const common = require('../common');
const Readable = require('_stream_readable');
const { Readable } = require('stream');
const EE = require('events').EventEmitter;
const oldStream = new EE();

View File

@ -2,7 +2,7 @@
const common = require('../common');
const assert = require('assert');
const Readable = require('_stream_readable');
const { Readable } = require('stream');
const EE = require('events').EventEmitter;
class LegacyStream extends EE {

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const Readable = require('_stream_readable');
const Writable = require('_stream_writable');
const { Readable, Writable } = require('stream');
const EE = require('events').EventEmitter;
function runTest(highWaterMark, objectMode, produce) {

View File

@ -22,7 +22,7 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const R = require('_stream_readable');
const { Readable: R } = require('stream');
class TestReader extends R {
constructor(n, opts) {

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const PassThrough = require('_stream_passthrough');
const Transform = require('_stream_transform');
const { PassThrough, Transform } = require('stream');
{
// Verify writable side consumption

View File

@ -22,8 +22,7 @@
'use strict';
const common = require('../common');
const W = require('_stream_writable');
const D = require('_stream_duplex');
const { Writable: W, Duplex: D } = require('stream');
const assert = require('assert');
class TestWriter extends W {