Provide a default script target for the document registry.
This commit is contained in:
parent
103f894d38
commit
d00ad19bd7
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ namespace ts {
|
|||
|
||||
const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true);
|
||||
let entry = bucket.get(path);
|
||||
const scriptTarget = scriptKind === ScriptKind.JSON ? ScriptTarget.JSON : compilationSettings.target;
|
||||
const scriptTarget = scriptKind === ScriptKind.JSON ? ScriptTarget.JSON : compilationSettings.target || ScriptTarget.ES5;
|
||||
if (!entry && externalCache) {
|
||||
const sourceFile = externalCache.getDocument(key, path);
|
||||
if (sourceFile) {
|
||||
|
@ -199,7 +199,7 @@ namespace ts {
|
|||
|
||||
if (!entry) {
|
||||
// Have never seen this file with these settings. Create a new source file for it.
|
||||
const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget!, version, /*setNodeParents*/ false, scriptKind); // TODO: GH#18217
|
||||
const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, /*setNodeParents*/ false, scriptKind); // TODO: GH#18217
|
||||
if (externalCache) {
|
||||
externalCache.setDocument(key, path, sourceFile);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue