mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

Unused variables were removed from stream-exception test. PR-URL: https://github.com/nodejs/node/pull/47167 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
24 lines
587 B
JavaScript
24 lines
587 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const JSStreamWrap = require('internal/js_stream_socket');
|
|
const { Duplex } = require('stream');
|
|
|
|
process.once('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'exception!');
|
|
}));
|
|
|
|
const socket = new JSStreamWrap(new Duplex({
|
|
read: common.mustCall(),
|
|
write: common.mustCall(() => {
|
|
throw new Error('exception!');
|
|
})
|
|
}));
|
|
|
|
socket.end('foo');
|
|
socket.on('error', common.expectsError({
|
|
name: 'Error',
|
|
message: 'write EPROTO'
|
|
}));
|