mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
efd40eadab
Refs: https://github.com/nodejs/node/issues/39356 PR-URL: https://github.com/nodejs/node/pull/39364 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
25 lines
507 B
JavaScript
25 lines
507 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const stream = require('stream');
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'kaboom');
|
|
}));
|
|
|
|
const writable = new stream.Writable();
|
|
const _err = new Error('kaboom');
|
|
|
|
writable._write = (chunk, encoding, cb) => {
|
|
cb();
|
|
};
|
|
writable._final = (cb) => {
|
|
cb(_err);
|
|
};
|
|
|
|
writable.write('asd');
|
|
writable.end(common.mustCall((err) => {
|
|
assert.strictEqual(err, _err);
|
|
}));
|