mirror of https://github.com/nodejs/node.git
16 lines
323 B
JavaScript
16 lines
323 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const { Readable } = require('stream');
|
|
|
|
{
|
|
const r = Readable.from(['data']);
|
|
|
|
const wrapper = Readable.fromWeb(Readable.toWeb(r));
|
|
|
|
wrapper.on('data', () => {
|
|
// Destroying wrapper while emitting data should not cause uncaught
|
|
// exceptions
|
|
wrapper.destroy();
|
|
});
|
|
}
|