Adds destroy() and _destroy() methods to Readable, Writable, Duplex and Transform. It also standardizes the behavior and the implementation of destroy(), which has been inconsistent in userland and core. This PR also updates all the subsystems of core to use the new destroy(). PR-URL: https://github.com/nodejs/node/pull/12925 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
10 lines
222 B
JavaScript
10 lines
222 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
process.on('uncaughtException', common.expectsError({
|
|
code: 'ERR_STDOUT_CLOSE',
|
|
type: Error,
|
|
message: 'process.stdout cannot be closed'
|
|
}));
|
|
|
|
process.stdout.end();
|