mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
db79783bad
commit
f8b9831338
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
14
test/parallel/test-stream-aliases-legacy.js
Normal file
14
test/parallel/test-stream-aliases-legacy.js
Normal 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'));
|
@ -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) {
|
||||
|
@ -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.
|
||||
{
|
||||
|
@ -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' });
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const Readable = require('_stream_readable');
|
||||
const { Readable } = require('stream');
|
||||
const assert = require('assert');
|
||||
|
||||
let buf = '';
|
||||
|
@ -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) {
|
||||
|
@ -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');
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user