11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { Writable } = require('stream'); 51cb0ef41Sopenharmony_ciconst { Console } = require('console'); 61cb0ef41Sopenharmony_ciconst { EventEmitter } = require('events'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst stream = new Writable({ 91cb0ef41Sopenharmony_ci write(chunk, enc, cb) { 101cb0ef41Sopenharmony_ci cb(); 111cb0ef41Sopenharmony_ci }, 121cb0ef41Sopenharmony_ci writev(chunks, cb) { 131cb0ef41Sopenharmony_ci setTimeout(cb, 10, new Error('kaboom')); 141cb0ef41Sopenharmony_ci } 151cb0ef41Sopenharmony_ci}); 161cb0ef41Sopenharmony_ciconst myConsole = new Console(stream, stream); 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ciprocess.on('warning', common.mustNotCall()); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_cistream.cork(); 211cb0ef41Sopenharmony_cifor (let i = 0; i < EventEmitter.defaultMaxListeners + 1; i++) { 221cb0ef41Sopenharmony_ci myConsole.log('a message'); 231cb0ef41Sopenharmony_ci} 241cb0ef41Sopenharmony_cistream.uncork(); 25