2017-11-05 12:26:27 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const { Writable } = require('stream');
|
|
|
|
const { Console } = require('console');
|
|
|
|
const { EventEmitter } = require('events');
|
|
|
|
|
|
|
|
const stream = new Writable({
|
|
|
|
write(chunk, enc, cb) {
|
|
|
|
cb();
|
|
|
|
},
|
|
|
|
writev(chunks, cb) {
|
|
|
|
setTimeout(cb, 10, new Error('kaboom'));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
const myConsole = new Console(stream, stream);
|
|
|
|
|
2022-08-30 20:31:11 +00:00
|
|
|
process.on('warning', common.mustNotCall());
|
2017-11-05 12:26:27 +00:00
|
|
|
|
|
|
|
stream.cork();
|
|
|
|
for (let i = 0; i < EventEmitter.defaultMaxListeners + 1; i++) {
|
|
|
|
myConsole.log('a message');
|
|
|
|
}
|
|
|
|
stream.uncork();
|