File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,12 @@ export class CompilerHost implements ts.CompilerHost {
366
366
// reused across multiple tests. In that case, we cache the SourceFile we parse
367
367
// so that it can be reused across multiple tests to avoid the cost of
368
368
// repeatedly parsing the same file over and over (such as lib.d.ts).
369
- const cacheKey = this . vfs . shadowRoot && `SourceFile[languageVersionOrOptions=${ languageVersionOrOptions !== undefined ? JSON . stringify ( languageVersionOrOptions ) : undefined } ,setParentNodes=${ this . _setParentNodes } ]` ;
369
+
370
+ // TODO(jakebailey): the below is totally wrong; languageVersionOrOptions can be an object,
371
+ // and so any options bag will be keyed as "[object Object]", and we'll incorrectly share
372
+ // SourceFiles parsed with different options. But fixing this doesn't expose any bugs and
373
+ // doubles the memory usage of a test run, so I'm leaving it for now.
374
+ const cacheKey = this . vfs . shadowRoot && `SourceFile[languageVersionOrOptions=${ languageVersionOrOptions } ,setParentNodes=${ this . _setParentNodes } ]` ;
370
375
if ( cacheKey ) {
371
376
const meta = this . vfs . filemeta ( canonicalFileName ) ;
372
377
const sourceFileFromMetadata = meta . get ( cacheKey ) as ts . SourceFile | undefined ;
You can’t perform that action at this time.
0 commit comments