@@ -14,18 +14,6 @@ interface String { charAt: any; }
14
14
interface Array<T> { length: number; [n: number]: T; }`
15
15
} ;
16
16
17
- export const safeList = {
18
- path : "/safeList.json" as Path ,
19
- content : JSON . stringify ( {
20
- commander : "commander" ,
21
- express : "express" ,
22
- jquery : "jquery" ,
23
- lodash : "lodash" ,
24
- moment : "moment" ,
25
- chroma : "chroma-js"
26
- } )
27
- } ;
28
-
29
17
function getExecutingFilePathFromLibFile ( ) : string {
30
18
return combinePaths ( getDirectoryPath ( libFile . path ) , "tsc.js" ) ;
31
19
}
@@ -43,11 +31,11 @@ interface Array<T> { length: number; [n: number]: T; }`
43
31
}
44
32
45
33
export function createWatchedSystem ( fileOrFolderList : readonly FileOrFolderOrSymLink [ ] , params ?: TestServerHostCreationParameters ) : TestServerHost {
46
- return new TestServerHost ( /*withSafelist*/ false , fileOrFolderList , params ) ;
34
+ return new TestServerHost ( fileOrFolderList , params ) ;
47
35
}
48
36
49
37
export function createServerHost ( fileOrFolderList : readonly FileOrFolderOrSymLink [ ] , params ?: TestServerHostCreationParameters ) : TestServerHost {
50
- const host = new TestServerHost ( /*withSafelist*/ true , fileOrFolderList , params ) ;
38
+ const host = new TestServerHost ( fileOrFolderList , params ) ;
51
39
// Just like sys, patch the host to use writeFile
52
40
patchWriteFileEnsuringDirectory ( host ) ;
53
41
return host ;
@@ -338,7 +326,6 @@ interface Array<T> { length: number; [n: number]: T; }`
338
326
private readonly inodes ?: ESMap < Path , number > ;
339
327
watchDirectory : HostWatchDirectory ;
340
328
constructor (
341
- public withSafeList : boolean ,
342
329
fileOrFolderorSymLinkList : readonly FileOrFolderOrSymLink [ ] ,
343
330
{
344
331
useCaseSensitiveFileNames, executingFilePath, currentDirectory,
@@ -430,47 +417,14 @@ interface Array<T> { length: number; [n: number]: T; }`
430
417
431
418
private reloadFS ( fileOrFolderOrSymLinkList : readonly FileOrFolderOrSymLink [ ] ) {
432
419
Debug . assert ( this . fs . size === 0 ) ;
433
- fileOrFolderOrSymLinkList = fileOrFolderOrSymLinkList . concat ( this . withSafeList ? safeList : [ ] ) ;
434
420
const filesOrFoldersToLoad : readonly FileOrFolderOrSymLink [ ] = ! this . windowsStyleRoot ? fileOrFolderOrSymLinkList :
435
421
fileOrFolderOrSymLinkList . map < FileOrFolderOrSymLink > ( f => {
436
422
const result = clone ( f ) ;
437
423
result . path = this . getHostSpecificPath ( f . path ) ;
438
424
return result ;
439
425
} ) ;
440
426
for ( const fileOrDirectory of filesOrFoldersToLoad ) {
441
- const path = this . toFullPath ( fileOrDirectory . path ) ;
442
- // If its a change
443
- const currentEntry = this . fs . get ( path ) ;
444
- if ( currentEntry ) {
445
- if ( isFsFile ( currentEntry ) ) {
446
- if ( isFile ( fileOrDirectory ) ) {
447
- // Update file
448
- if ( currentEntry . content !== fileOrDirectory . content ) {
449
- this . modifyFile ( fileOrDirectory . path , fileOrDirectory . content ) ;
450
- }
451
- }
452
- else {
453
- // TODO: Changing from file => folder/Symlink
454
- }
455
- }
456
- else if ( isFsSymLink ( currentEntry ) ) {
457
- // TODO: update symlinks
458
- }
459
- else {
460
- // Folder
461
- if ( isFile ( fileOrDirectory ) ) {
462
- // TODO: Changing from folder => file
463
- }
464
- else {
465
- // Folder update: Nothing to do.
466
- currentEntry . modifiedTime = this . now ( ) ;
467
- this . invokeFsWatches ( currentEntry . fullPath , "change" ) ;
468
- }
469
- }
470
- }
471
- else {
472
- this . ensureFileOrFolder ( fileOrDirectory ) ;
473
- }
427
+ this . ensureFileOrFolder ( fileOrDirectory ) ;
474
428
}
475
429
}
476
430
0 commit comments