@@ -1443,12 +1443,6 @@ interface DirectoryWatcher extends FileWatcher {
1443
1443
referenceCount : number ;
1444
1444
}
1445
1445
1446
- declare const require : any ;
1447
- declare const process : any ;
1448
- declare const global : any ;
1449
- declare const __filename : string ;
1450
- declare const __dirname : string ;
1451
-
1452
1446
// TODO: GH#18217 this is used as if it's certainly defined in many places.
1453
1447
export let sys : System = ( ( ) => {
1454
1448
// NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual
@@ -1507,7 +1501,7 @@ export let sys: System = (() => {
1507
1501
getAccessibleSortedChildDirectories : path => getAccessibleFileSystemEntries ( path ) . directories ,
1508
1502
realpath,
1509
1503
tscWatchFile : process . env . TSC_WATCHFILE ,
1510
- useNonPollingWatchers : process . env . TSC_NONPOLLING_WATCHER ,
1504
+ useNonPollingWatchers : ! ! process . env . TSC_NONPOLLING_WATCHER ,
1511
1505
tscWatchDirectory : process . env . TSC_WATCHDIRECTORY ,
1512
1506
inodeWatching : isLinuxOrMacOs ,
1513
1507
sysLog,
@@ -1584,7 +1578,7 @@ export let sys: System = (() => {
1584
1578
disableCPUProfiler,
1585
1579
cpuProfilingEnabled : ( ) => ! ! activeSession || contains ( process . execArgv , "--cpu-prof" ) || contains ( process . execArgv , "--prof" ) ,
1586
1580
realpath,
1587
- debugMode : ! ! process . env . NODE_INSPECTOR_IPC || ! ! process . env . VSCODE_INSPECTOR_OPTIONS || some ( process . execArgv as string [ ] , arg => / ^ - - ( i n s p e c t | d e b u g ) ( - b r k ) ? ( = \d + ) ? $ / i. test ( arg ) ) ,
1581
+ debugMode : ! ! process . env . NODE_INSPECTOR_IPC || ! ! process . env . VSCODE_INSPECTOR_OPTIONS || some ( process . execArgv , arg => / ^ - - ( i n s p e c t | d e b u g ) ( - b r k ) ? ( = \d + ) ? $ / i. test ( arg ) ) ,
1588
1582
tryEnableSourceMapsForHost ( ) {
1589
1583
try {
1590
1584
( require ( "source-map-support" ) as typeof import ( "source-map-support" ) ) . install ( ) ;
@@ -1599,8 +1593,9 @@ export let sys: System = (() => {
1599
1593
process . stdout . write ( "\x1Bc" ) ;
1600
1594
} ,
1601
1595
setBlocking : ( ) => {
1602
- if ( process . stdout && process . stdout . _handle && process . stdout . _handle . setBlocking ) {
1603
- process . stdout . _handle . setBlocking ( true ) ;
1596
+ const handle = ( process . stdout as any ) ?. _handle as { setBlocking ?: ( value : boolean ) => void } ;
1597
+ if ( handle && handle . setBlocking ) {
1598
+ handle . setBlocking ( true ) ;
1604
1599
}
1605
1600
} ,
1606
1601
bufferFrom,
0 commit comments