@@ -22,33 +22,17 @@ namespace ts {
22
22
newLine : "\r\n" ,
23
23
useCaseSensitiveFileNames : false ,
24
24
write : noop ,
25
- readFile : ( path : string ) : string => {
26
- return path in fileMap ? fileMap [ path ] . content : undefined ;
27
- } ,
28
- writeFile : ( _path : string , _data : string , _writeByteOrderMark ?: boolean ) => {
29
- return ts . notImplemented ( ) ;
30
- } ,
31
- resolvePath : ( _path : string ) : string => {
32
- return ts . notImplemented ( ) ;
33
- } ,
34
- fileExists : ( path : string ) : boolean => {
35
- return path in fileMap ;
36
- } ,
37
- directoryExists : ( path : string ) : boolean => {
38
- return existingDirectories [ path ] || false ;
39
- } ,
25
+ readFile : path => path in fileMap ? fileMap [ path ] . content : undefined ,
26
+ writeFile : notImplemented ,
27
+ resolvePath : notImplemented ,
28
+ fileExists : path => path in fileMap ,
29
+ directoryExists : path => existingDirectories [ path ] || false ,
40
30
createDirectory : noop ,
41
- getExecutingFilePath : ( ) : string => {
42
- return "" ;
43
- } ,
44
- getCurrentDirectory : ( ) : string => {
45
- return "" ;
46
- } ,
31
+ getExecutingFilePath : ( ) => "" ,
32
+ getCurrentDirectory : ( ) => "" ,
47
33
getDirectories : ( ) => [ ] ,
48
34
getEnvironmentVariable : ( ) => "" ,
49
- readDirectory : ( _path : string , _extension ?: string [ ] , _exclude ?: string [ ] , _include ?: string [ ] ) : string [ ] => {
50
- return ts . notImplemented ( ) ;
51
- } ,
35
+ readDirectory : notImplemented ,
52
36
exit : noop ,
53
37
watchFile : ( ) => ( {
54
38
close : noop
@@ -58,8 +42,8 @@ namespace ts {
58
42
} ) ,
59
43
setTimeout,
60
44
clearTimeout,
61
- setImmediate,
62
- clearImmediate
45
+ setImmediate : typeof setImmediate !== "undefined" ? setImmediate : action => setTimeout ( action , 0 ) ,
46
+ clearImmediate : typeof clearImmediate !== "undefined" ? clearImmediate : clearTimeout
63
47
} ;
64
48
}
65
49
0 commit comments