mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 13:28:42 +00:00

If autoDestroy then we should still throw on unhandled errors. PR-URL: https://github.com/nodejs/node/pull/29806 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Co-Authored-By: Trivikram Kamat <trivikr.dev@gmail.com>
22 lines
413 B
JavaScript
22 lines
413 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Readable, Writable } = require('stream');
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'asd');
|
|
}));
|
|
|
|
const r = new Readable({
|
|
read() {
|
|
this.push('asd');
|
|
}
|
|
});
|
|
const w = new Writable({
|
|
autoDestroy: true,
|
|
write() {}
|
|
});
|
|
|
|
r.pipe(w);
|
|
w.destroy(new Error('asd'));
|