@@ -5,8 +5,8 @@ describe("DocumentRegistry", () => {
5
5
var documentRegistry = ts . createDocumentRegistry ( ) ;
6
6
var defaultCompilerOptions = ts . getDefaultCompilerOptions ( ) ;
7
7
8
- var f1 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
9
- var f2 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
8
+ var f1 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
9
+ var f2 = documentRegistry . acquireDocument ( "file1.ts" , defaultCompilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
10
10
11
11
assert ( f1 === f2 , "DocumentRegistry should return the same document for the same name" ) ;
12
12
} ) ;
@@ -17,21 +17,21 @@ describe("DocumentRegistry", () => {
17
17
18
18
// change compilation setting that doesn't affect parsing - should have the same document
19
19
compilerOptions . declaration = true ;
20
- var f1 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
20
+ var f1 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
21
21
compilerOptions . declaration = false ;
22
- var f2 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
22
+ var f2 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
23
23
24
24
assert ( f1 === f2 , "Expected to have the same document instance" ) ;
25
25
26
26
27
27
// change value of compilation setting that is used during production of AST - new document is required
28
28
compilerOptions . target = ts . ScriptTarget . ES3 ;
29
- var f3 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
29
+ var f3 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
30
30
31
31
assert ( f1 !== f3 , "Changed target: Expected to have different instances of document" ) ;
32
32
33
33
compilerOptions . module = ts . ModuleKind . CommonJS ;
34
- var f4 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , 1 , false ) ;
34
+ var f4 = documentRegistry . acquireDocument ( "file1.ts" , compilerOptions , TypeScript . ScriptSnapshot . fromString ( "var x = 1;" ) , "1" , false ) ;
35
35
36
36
assert ( f1 !== f4 , "Changed module: Expected to have different instances of document" ) ;
37
37
} ) ;
0 commit comments