@@ -26,16 +26,20 @@ common.crashOnUnhandledRejection();
2626 hooks . disable ( ) ;
2727 delete providers . NONE ; // Should never be used.
2828
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+
2933 // TODO(jasnell): Test for these
3034 delete providers . HTTP2SESSION ;
3135 delete providers . HTTP2STREAM ;
3236 delete providers . HTTP2PING ;
3337 delete providers . HTTP2SETTINGS ;
3438
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 ) ;
3943 } ) ) ;
4044}
4145
@@ -256,44 +260,6 @@ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
256260 tls_wrap . wrap ( tcp . _externalStream , credentials . context , true ) , 'TLSWrap' ) ;
257261}
258262
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-
297263{
298264 const binding = process . binding ( 'udp_wrap' ) ;
299265 const handle = new binding . UDP ( ) ;
0 commit comments