summaryrefslogtreecommitdiff
path: root/test/pseudo-tty
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2017-05-06 14:20:52 +0200
committerMatteo Collina <hello@matteocollina.com>2017-05-22 08:34:14 +0200
commit330c8d743e33a83f85389ea8a64e3d3854ea0048 (patch)
treee3f72136564bc2637e1043133b9f99713d4753b2 /test/pseudo-tty
parentd54ec726cc9d0d293e61dc0dba61a09429e4cbaf (diff)
downloadandroid-node-v8-330c8d743e33a83f85389ea8a64e3d3854ea0048.tar.gz
android-node-v8-330c8d743e33a83f85389ea8a64e3d3854ea0048.tar.bz2
android-node-v8-330c8d743e33a83f85389ea8a64e3d3854ea0048.zip
stream: add destroy and _destroy methods.
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>
Diffstat (limited to 'test/pseudo-tty')
-rw-r--r--test/pseudo-tty/test-tty-stdout-end.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/pseudo-tty/test-tty-stdout-end.js b/test/pseudo-tty/test-tty-stdout-end.js
index 3c91977f90..2ec7ca9114 100644
--- a/test/pseudo-tty/test-tty-stdout-end.js
+++ b/test/pseudo-tty/test-tty-stdout-end.js
@@ -1,10 +1,10 @@
'use strict';
const common = require('../common');
-const assert = require('assert');
-assert.throws(() => process.stdout.end(),
- common.expectsError({
- code: 'ERR_STDOUT_CLOSE',
- type: Error,
- message: 'process.stdout cannot be closed'
- }));
+process.on('uncaughtException', common.expectsError({
+ code: 'ERR_STDOUT_CLOSE',
+ type: Error,
+ message: 'process.stdout cannot be closed'
+}));
+
+process.stdout.end();