@@ -26,16 +26,20 @@ common.crashOnUnhandledRejection();
26
26
hooks . disable ( ) ;
27
27
delete providers . NONE ; // Should never be used.
28
28
29
+ // See test/pseudo-tty/test-async-wrap-getasyncid-tty.js
30
+ // Requires an 'actual' tty fd to be available.
31
+ delete providers . TTYWRAP ;
32
+
29
33
// TODO(jasnell): Test for these
30
34
delete providers . HTTP2SESSION ;
31
35
delete providers . HTTP2STREAM ;
32
36
delete providers . HTTP2PING ;
33
37
delete providers . HTTP2SETTINGS ;
34
38
35
- const obj_keys = Object . keys ( providers ) ;
36
- if ( obj_keys . length > 0 )
37
- process . _rawDebug ( obj_keys ) ;
38
- assert . strictEqual ( obj_keys . length , 0 ) ;
39
+ const objKeys = Object . keys ( providers ) ;
40
+ if ( objKeys . length > 0 )
41
+ process . _rawDebug ( objKeys ) ;
42
+ assert . strictEqual ( objKeys . length , 0 ) ;
39
43
} ) ) ;
40
44
}
41
45
@@ -256,44 +260,6 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
256
260
tls_wrap . wrap ( tcp . _externalStream , credentials . context , true ) , 'TLSWrap' ) ;
257
261
}
258
262
259
-
260
- {
261
- // Do our best to grab a tty fd.
262
- function getTTYfd ( ) {
263
- const tty = require ( 'tty' ) ;
264
- let ttyFd = [ 0 , 1 , 2 ] . find ( tty . isatty ) ;
265
- if ( ttyFd === undefined ) {
266
- try {
267
- ttyFd = fs . openSync ( '/dev/tty' ) ;
268
- } catch ( e ) {
269
- // There aren't any tty fd's available to use.
270
- return - 1 ;
271
- }
272
- }
273
- return ttyFd ;
274
- }
275
-
276
- const ttyFd = getTTYfd ( ) ;
277
- if ( ttyFd >= 0 ) {
278
- const tty_wrap = process . binding ( 'tty_wrap' ) ;
279
- // fd may still be invalid, so guard against it.
280
- const handle = ( ( ) => {
281
- try {
282
- return new tty_wrap . TTY ( ttyFd , false ) ;
283
- } catch ( e ) {
284
- return null ;
285
- }
286
- } ) ( ) ;
287
- if ( handle !== null )
288
- testInitialized ( handle , 'TTY' ) ;
289
- else
290
- delete providers . TTYWRAP ;
291
- } else {
292
- delete providers . TTYWRAP ;
293
- }
294
- }
295
-
296
-
297
263
{
298
264
const binding = process . binding ( 'udp_wrap' ) ;
299
265
const handle = new binding . UDP ( ) ;
0 commit comments