@@ -1240,6 +1240,8 @@ var ts;
1240
1240
ts.returnFalse = returnFalse;
1241
1241
function returnTrue() { return true; }
1242
1242
ts.returnTrue = returnTrue;
1243
+ function returnUndefined() { return undefined; }
1244
+ ts.returnUndefined = returnUndefined;
1243
1245
function identity(x) { return x; }
1244
1246
ts.identity = identity;
1245
1247
function toLowerCase(x) { return x.toLowerCase(); }
@@ -4331,7 +4333,7 @@ var ts;
4331
4333
Add_missing_new_operator_to_all_calls: diag(95072, ts.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"),
4332
4334
Add_names_to_all_parameters_without_names: diag(95073, ts.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"),
4333
4335
Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"),
4334
- Convert_to_named_parameters : diag(95075, ts.DiagnosticCategory.Message, "Convert_to_named_parameters_95075 ", "Convert to named parameters "),
4336
+ Convert_parameters_to_destructured_object : diag(95075, ts.DiagnosticCategory.Message, "Convert_parameters_to_destructured_object_95075 ", "Convert parameters to destructured object "),
4335
4337
};
4336
4338
})(ts || (ts = {}));
4337
4339
var ts;
@@ -8980,21 +8982,25 @@ var ts;
8980
8982
function getSourceFilesToEmit(host, targetSourceFile) {
8981
8983
var options = host.getCompilerOptions();
8982
8984
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
8985
+ var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
8983
8986
if (options.outFile || options.out) {
8984
8987
var moduleKind = ts.getEmitModuleKind(options);
8985
8988
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
8986
8989
return ts.filter(host.getSourceFiles(), function (sourceFile) {
8987
- return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary);
8990
+ return (moduleEmitEnabled_1 || !ts.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect );
8988
8991
});
8989
8992
}
8990
8993
else {
8991
8994
var sourceFiles = targetSourceFile === undefined ? host.getSourceFiles() : [targetSourceFile];
8992
- return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary); });
8995
+ return ts.filter(sourceFiles, function (sourceFile) { return sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect ); });
8993
8996
}
8994
8997
}
8995
8998
ts.getSourceFilesToEmit = getSourceFilesToEmit;
8996
- function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary) {
8997
- return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) && !sourceFile.isDeclarationFile && !isSourceFileFromExternalLibrary(sourceFile);
8999
+ function sourceFileMayBeEmitted(sourceFile, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect) {
9000
+ return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) &&
9001
+ !sourceFile.isDeclarationFile &&
9002
+ !isSourceFileFromExternalLibrary(sourceFile) &&
9003
+ !(isJsonSourceFile(sourceFile) && getResolvedProjectReferenceToRedirect(sourceFile.fileName));
8998
9004
}
8999
9005
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
9000
9006
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -39197,6 +39203,7 @@ var ts;
39197
39203
function checkNestedBlockScopedBinding(node, symbol) {
39198
39204
if (languageVersion >= 2 ||
39199
39205
(symbol.flags & (2 | 32)) === 0 ||
39206
+ ts.isSourceFile(symbol.valueDeclaration) ||
39200
39207
symbol.valueDeclaration.parent.kind === 274) {
39201
39208
return;
39202
39209
}
@@ -46674,7 +46681,7 @@ var ts;
46674
46681
var promisedType = getPromisedTypeOfPromise(returnType);
46675
46682
var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
46676
46683
if (promisedType) {
46677
- checkTypeAssignableTo (awaitedType, promisedType, node);
46684
+ checkTypeAssignableToAndOptionallyElaborate (awaitedType, promisedType, node, node.expression );
46678
46685
}
46679
46686
}
46680
46687
else {
@@ -48812,7 +48819,7 @@ var ts;
48812
48819
return undefined;
48813
48820
}
48814
48821
function isSymbolOfDeclarationWithCollidingName(symbol) {
48815
- if (symbol.flags & 418) {
48822
+ if (symbol.flags & 418 && !ts.isSourceFile(symbol.valueDeclaration) ) {
48816
48823
var links = getSymbolLinks(symbol);
48817
48824
if (links.isDeclarationWithCollidingName === undefined) {
48818
48825
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -53573,7 +53580,7 @@ var ts;
53573
53580
ts.nullTransformationContext = {
53574
53581
enableEmitNotification: ts.noop,
53575
53582
enableSubstitution: ts.noop,
53576
- endLexicalEnvironment: function () { return undefined; } ,
53583
+ endLexicalEnvironment: ts.returnUndefined ,
53577
53584
getCompilerOptions: ts.notImplemented,
53578
53585
getEmitHost: ts.notImplemented,
53579
53586
getEmitResolver: ts.notImplemented,
@@ -67473,18 +67480,19 @@ var ts;
67473
67480
function rootDirOfOptions(configFile) {
67474
67481
return configFile.options.rootDir || ts.getDirectoryPath(ts.Debug.assertDefined(configFile.options.configFilePath));
67475
67482
}
67483
+ function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir) {
67484
+ return outputDir ?
67485
+ ts.resolvePath(outputDir, ts.getRelativePathFromDirectory(rootDirOfOptions(configFile), inputFileName, ignoreCase)) :
67486
+ inputFileName;
67487
+ }
67476
67488
function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase) {
67477
67489
ts.Debug.assert(!ts.fileExtensionIs(inputFileName, ".d.ts") && ts.hasTSFileExtension(inputFileName));
67478
- var relativePath = ts.getRelativePathFromDirectory(rootDirOfOptions(configFile), inputFileName, ignoreCase);
67479
- var outputPath = ts.resolvePath(configFile.options.declarationDir || configFile.options.outDir || ts.getDirectoryPath(ts.Debug.assertDefined(configFile.options.configFilePath)), relativePath);
67480
- return ts.changeExtension(outputPath, ".d.ts");
67490
+ return ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir), ".d.ts");
67481
67491
}
67482
67492
ts.getOutputDeclarationFileName = getOutputDeclarationFileName;
67483
67493
function getOutputJSFileName(inputFileName, configFile, ignoreCase) {
67484
- var relativePath = ts.getRelativePathFromDirectory(rootDirOfOptions(configFile), inputFileName, ignoreCase);
67485
- var outputPath = ts.resolvePath(configFile.options.outDir || ts.getDirectoryPath(ts.Debug.assertDefined(configFile.options.configFilePath)), relativePath);
67486
67494
var isJsonFile = ts.fileExtensionIs(inputFileName, ".json");
67487
- var outputFileName = ts.changeExtension(outputPath , isJsonFile ?
67495
+ var outputFileName = ts.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir) , isJsonFile ?
67488
67496
".json" :
67489
67497
ts.fileExtensionIs(inputFileName, ".tsx") && configFile.options.jsx === 1 ?
67490
67498
".jsx" :
@@ -67542,6 +67550,9 @@ var ts;
67542
67550
if (jsFilePath)
67543
67551
return jsFilePath;
67544
67552
}
67553
+ var buildInfoPath = getOutputPathForBuildInfo(configFile.options);
67554
+ if (buildInfoPath)
67555
+ return buildInfoPath;
67545
67556
return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
67546
67557
}
67547
67558
ts.getFirstProjectOutput = getFirstProjectOutput;
@@ -67893,11 +67904,12 @@ var ts;
67893
67904
getCompilerOptions: function () { return config.options; },
67894
67905
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
67895
67906
getNewLine: function () { return host.getNewLine(); },
67896
- getSourceFile: function () { return undefined; } ,
67897
- getSourceFileByPath: function () { return undefined; } ,
67907
+ getSourceFile: ts.returnUndefined ,
67908
+ getSourceFileByPath: ts.returnUndefined ,
67898
67909
getSourceFiles: function () { return sourceFilesForJsEmit; },
67899
67910
getLibFileFromReference: ts.notImplemented,
67900
67911
isSourceFileFromExternalLibrary: ts.returnFalse,
67912
+ getResolvedProjectReferenceToRedirect: ts.returnUndefined,
67901
67913
writeFile: function (name, text, writeByteOrderMark) {
67902
67914
switch (name) {
67903
67915
case jsFilePath:
@@ -67937,7 +67949,7 @@ var ts;
67937
67949
fileExists: function (f) { return host.fileExists(f); },
67938
67950
directoryExists: host.directoryExists && (function (f) { return host.directoryExists(f); }),
67939
67951
useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },
67940
- getProgramBuildInfo: function () { return undefined; }
67952
+ getProgramBuildInfo: ts.returnUndefined
67941
67953
};
67942
67954
emitFiles(ts.notImplementedResolver, emitHost, undefined, false, ts.getTransformers(config.options));
67943
67955
return outputFiles;
@@ -72496,7 +72508,7 @@ var ts;
72496
72508
}
72497
72509
function getCommonSourceDirectory() {
72498
72510
if (commonSourceDirectory === undefined) {
72499
- var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary); });
72511
+ var emittedFiles = ts.filter(files, function (file) { return ts.sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect ); });
72500
72512
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
72501
72513
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
72502
72514
}
@@ -72793,7 +72805,8 @@ var ts;
72793
72805
}
72794
72806
function getEmitHost(writeFileCallback) {
72795
72807
return __assign({ getPrependNodes: getPrependNodes,
72796
- getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
72808
+ getCanonicalFileName: getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, getCurrentDirectory: function () { return currentDirectory; }, getNewLine: function () { return host.getNewLine(); }, getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, getSourceFiles: program.getSourceFiles, getLibFileFromReference: program.getLibFileFromReference, isSourceFileFromExternalLibrary: isSourceFileFromExternalLibrary,
72809
+ getResolvedProjectReferenceToRedirect: getResolvedProjectReferenceToRedirect, writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError, sourceFiles) { return host.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles); }), isEmitBlocked: isEmitBlocked, readFile: function (f) { return host.readFile(f); }, fileExists: function (f) {
72797
72810
var path = toPath(f);
72798
72811
if (getSourceFileByPath(path))
72799
72812
return true;
@@ -73788,14 +73801,15 @@ var ts;
73788
73801
}
73789
73802
verifyProjectReferences();
73790
73803
if (options.composite) {
73791
- var sourceFiles = files.filter(function (f) { return !f.isDeclarationFile; });
73792
- if (rootNames.length < sourceFiles.length) {
73793
- var normalizedRootNames = rootNames.map(function (r) { return ts.normalizePath(r).toLowerCase(); });
73794
- for (var _i = 0, _a = sourceFiles.map(function (f) { return ts.normalizePath(f.path).toLowerCase(); }); _i < _a.length; _i++) {
73795
- var file = _a[_i];
73796
- if (normalizedRootNames.indexOf(file) === -1) {
73797
- programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file));
73798
- }
73804
+ var rootPaths = rootNames.map(toPath);
73805
+ for (var _i = 0, files_3 = files; _i < files_3.length; _i++) {
73806
+ var file = files_3[_i];
73807
+ if (file.isDeclarationFile)
73808
+ continue;
73809
+ if (ts.isJsonSourceFile(file) && getResolvedProjectReferenceToRedirect(file.fileName))
73810
+ continue;
73811
+ if (rootPaths.indexOf(file.path) === -1) {
73812
+ programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName));
73799
73813
}
73800
73814
}
73801
73815
}
@@ -74132,7 +74146,7 @@ var ts;
74132
74146
readFile: function (f) { return directoryStructureHost.readFile(f); },
74133
74147
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
74134
74148
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
74135
- onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || (function () { return undefined; }) ,
74149
+ onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || ts.returnUndefined ,
74136
74150
trace: host.trace ? function (s) { return host.trace(s); } : undefined
74137
74151
};
74138
74152
}
@@ -75130,7 +75144,7 @@ var ts;
75130
75144
backupState: ts.noop,
75131
75145
restoreState: ts.noop,
75132
75146
getProgram: ts.notImplemented,
75133
- getProgramOrUndefined: function () { return undefined; } ,
75147
+ getProgramOrUndefined: ts.returnUndefined ,
75134
75148
releaseProgram: ts.noop,
75135
75149
getCompilerOptions: function () { return state.compilerOptions; },
75136
75150
getSourceFile: ts.notImplemented,
@@ -76855,7 +76869,7 @@ var ts;
76855
76869
ts.createBuilderStatusReporter = createBuilderStatusReporter;
76856
76870
function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) {
76857
76871
var host = ts.createProgramHost(system, createProgram);
76858
- host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : function () { return undefined; } ;
76872
+ host.getModifiedTime = system.getModifiedTime ? function (path) { return system.getModifiedTime(path); } : ts.returnUndefined ;
76859
76873
host.setModifiedTime = system.setModifiedTime ? function (path, date) { return system.setModifiedTime(path, date); } : ts.noop;
76860
76874
host.deleteFile = system.deleteFile ? function (path) { return system.deleteFile(path); } : ts.noop;
76861
76875
host.reportDiagnostic = reportDiagnostic || ts.createDiagnosticReporter(system);
@@ -77094,12 +77108,12 @@ var ts;
77094
77108
newestInputFileTime = inputTime;
77095
77109
}
77096
77110
}
77097
- var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
77098
- if (outputs.length === 0) {
77111
+ if (!project.fileNames.length && !ts.canJsonReportNoInutFiles(project.raw)) {
77099
77112
return {
77100
77113
type: UpToDateStatusType.ContainerOnly
77101
77114
};
77102
77115
}
77116
+ var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
77103
77117
var oldestOutputFileName = "(none)";
77104
77118
var oldestOutputFileTime = maximumDate;
77105
77119
var newestOutputFileName = "(none)";
0 commit comments