mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
4a2bd69db9
Ensure errorEmitted is always set. Only emit 'error' once. PR-URL: https://github.com/nodejs/node/pull/29058 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
20 lines
398 B
JavaScript
20 lines
398 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { Writable, Readable } = require('stream');
|
|
|
|
{
|
|
const writable = new Writable();
|
|
writable.on('error', common.mustCall());
|
|
writable.end();
|
|
writable.write('h');
|
|
writable.write('h');
|
|
}
|
|
|
|
{
|
|
const readable = new Readable();
|
|
readable.on('error', common.mustCall());
|
|
readable.push(null);
|
|
readable.push('h');
|
|
readable.push('h');
|
|
}
|