@@ -182,7 +182,7 @@ namespace ts {
182
182
return matchFiles ( path , extensions , excludes , includes , /*useCaseSensitiveFileNames*/ false , shell . CurrentDirectory , getAccessibleFileSystemEntries ) ;
183
183
}
184
184
185
- return {
185
+ const wscriptSystem : System = {
186
186
args,
187
187
newLine : "\r\n" ,
188
188
useCaseSensitiveFileNames : false ,
@@ -200,8 +200,8 @@ namespace ts {
200
200
directoryExists ( path : string ) {
201
201
return fso . FolderExists ( path ) ;
202
202
} ,
203
- createDirectory ( this : System , directoryName : string ) {
204
- if ( ! this . directoryExists ( directoryName ) ) {
203
+ createDirectory ( directoryName : string ) {
204
+ if ( ! wscriptSystem . directoryExists ( directoryName ) ) {
205
205
fso . CreateFolder ( directoryName ) ;
206
206
}
207
207
} ,
@@ -221,6 +221,7 @@ namespace ts {
221
221
}
222
222
}
223
223
} ;
224
+ return wscriptSystem ;
224
225
}
225
226
226
227
function getNodeSystem ( ) : System {
@@ -439,7 +440,7 @@ namespace ts {
439
440
return filter < string > ( _fs . readdirSync ( path ) , p => fileSystemEntryExists ( combinePaths ( path , p ) , FileSystemEntryKind . Directory ) ) ;
440
441
}
441
442
442
- return {
443
+ const nodeSystem : System = {
443
444
args : process . argv . slice ( 2 ) ,
444
445
newLine : _os . EOL ,
445
446
useCaseSensitiveFileNames : useCaseSensitiveFileNames ,
@@ -500,8 +501,8 @@ namespace ts {
500
501
} ,
501
502
fileExists,
502
503
directoryExists,
503
- createDirectory ( this : System , directoryName : string ) {
504
- if ( ! this . directoryExists ( directoryName ) ) {
504
+ createDirectory ( directoryName : string ) {
505
+ if ( ! nodeSystem . directoryExists ( directoryName ) ) {
505
506
_fs . mkdirSync ( directoryName ) ;
506
507
}
507
508
} ,
@@ -549,6 +550,7 @@ namespace ts {
549
550
return _fs . realpathSync ( path ) ;
550
551
}
551
552
} ;
553
+ return nodeSystem ;
552
554
}
553
555
554
556
function getChakraSystem ( ) : System {
0 commit comments