Skip to content

Commit 105acf7

Browse files
Update LKG.
1 parent 5a8176e commit 105acf7

7 files changed

+327
-223
lines changed

lib/enu/diagnosticMessages.generated.json.lcg

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,12 @@
20432043
</Str>
20442044
<Disp Icon="Str" />
20452045
</Item>
2046+
<Item ItemId=";Convert_parameters_to_destructured_object_95075" ItemType="0" PsrId="306" Leaf="true">
2047+
<Str Cat="Text">
2048+
<Val><![CDATA[Convert parameters to destructured object]]></Val>
2049+
</Str>
2050+
<Disp Icon="Str" />
2051+
</Item>
20462052
<Item ItemId=";Convert_require_to_import_95047" ItemType="0" PsrId="306" Leaf="true">
20472053
<Str Cat="Text">
20482054
<Val><![CDATA[Convert 'require' to 'import']]></Val>
@@ -2067,12 +2073,6 @@
20672073
</Str>
20682074
<Disp Icon="Str" />
20692075
</Item>
2070-
<Item ItemId=";Convert_to_named_parameters_95075" ItemType="0" PsrId="306" Leaf="true">
2071-
<Str Cat="Text">
2072-
<Val><![CDATA[Convert to named parameters]]></Val>
2073-
</Str>
2074-
<Disp Icon="Str" />
2075-
</Item>
20762076
<Item ItemId=";Corrupted_locale_file_0_6051" ItemType="0" PsrId="306" Leaf="true">
20772077
<Str Cat="Text">
20782078
<Val><![CDATA[Corrupted locale file {0}.]]></Val>

lib/tsc.js

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,8 @@ var ts;
12401240
ts.returnFalse = returnFalse;
12411241
function returnTrue() { return true; }
12421242
ts.returnTrue = returnTrue;
1243+
function returnUndefined() { return undefined; }
1244+
ts.returnUndefined = returnUndefined;
12431245
function identity(x) { return x; }
12441246
ts.identity = identity;
12451247
function toLowerCase(x) { return x.toLowerCase(); }
@@ -4331,7 +4333,7 @@ var ts;
43314333
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"),
43324334
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"),
43334335
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"),
43354337
};
43364338
})(ts || (ts = {}));
43374339
var ts;
@@ -8980,21 +8982,25 @@ var ts;
89808982
function getSourceFilesToEmit(host, targetSourceFile) {
89818983
var options = host.getCompilerOptions();
89828984
var isSourceFileFromExternalLibrary = function (file) { return host.isSourceFileFromExternalLibrary(file); };
8985+
var getResolvedProjectReferenceToRedirect = function (fileName) { return host.getResolvedProjectReferenceToRedirect(fileName); };
89838986
if (options.outFile || options.out) {
89848987
var moduleKind = ts.getEmitModuleKind(options);
89858988
var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts.ModuleKind.AMD || moduleKind === ts.ModuleKind.System;
89868989
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);
89888991
});
89898992
}
89908993
else {
89918994
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); });
89938996
}
89948997
}
89958998
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));
89989004
}
89999005
ts.sourceFileMayBeEmitted = sourceFileMayBeEmitted;
90009006
function getSourceFilePathInNewDir(fileName, host, newDirPath) {
@@ -39197,6 +39203,7 @@ var ts;
3919739203
function checkNestedBlockScopedBinding(node, symbol) {
3919839204
if (languageVersion >= 2 ||
3919939205
(symbol.flags & (2 | 32)) === 0 ||
39206+
ts.isSourceFile(symbol.valueDeclaration) ||
3920039207
symbol.valueDeclaration.parent.kind === 274) {
3920139208
return;
3920239209
}
@@ -46674,7 +46681,7 @@ var ts;
4667446681
var promisedType = getPromisedTypeOfPromise(returnType);
4667546682
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);
4667646683
if (promisedType) {
46677-
checkTypeAssignableTo(awaitedType, promisedType, node);
46684+
checkTypeAssignableToAndOptionallyElaborate(awaitedType, promisedType, node, node.expression);
4667846685
}
4667946686
}
4668046687
else {
@@ -48812,7 +48819,7 @@ var ts;
4881248819
return undefined;
4881348820
}
4881448821
function isSymbolOfDeclarationWithCollidingName(symbol) {
48815-
if (symbol.flags & 418) {
48822+
if (symbol.flags & 418 && !ts.isSourceFile(symbol.valueDeclaration)) {
4881648823
var links = getSymbolLinks(symbol);
4881748824
if (links.isDeclarationWithCollidingName === undefined) {
4881848825
var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration);
@@ -53573,7 +53580,7 @@ var ts;
5357353580
ts.nullTransformationContext = {
5357453581
enableEmitNotification: ts.noop,
5357553582
enableSubstitution: ts.noop,
53576-
endLexicalEnvironment: function () { return undefined; },
53583+
endLexicalEnvironment: ts.returnUndefined,
5357753584
getCompilerOptions: ts.notImplemented,
5357853585
getEmitHost: ts.notImplemented,
5357953586
getEmitResolver: ts.notImplemented,
@@ -67473,18 +67480,19 @@ var ts;
6747367480
function rootDirOfOptions(configFile) {
6747467481
return configFile.options.rootDir || ts.getDirectoryPath(ts.Debug.assertDefined(configFile.options.configFilePath));
6747567482
}
67483+
function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir) {
67484+
return outputDir ?
67485+
ts.resolvePath(outputDir, ts.getRelativePathFromDirectory(rootDirOfOptions(configFile), inputFileName, ignoreCase)) :
67486+
inputFileName;
67487+
}
6747667488
function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase) {
6747767489
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");
6748167491
}
6748267492
ts.getOutputDeclarationFileName = getOutputDeclarationFileName;
6748367493
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);
6748667494
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 ?
6748867496
".json" :
6748967497
ts.fileExtensionIs(inputFileName, ".tsx") && configFile.options.jsx === 1 ?
6749067498
".jsx" :
@@ -67542,6 +67550,9 @@ var ts;
6754267550
if (jsFilePath)
6754367551
return jsFilePath;
6754467552
}
67553+
var buildInfoPath = getOutputPathForBuildInfo(configFile.options);
67554+
if (buildInfoPath)
67555+
return buildInfoPath;
6754567556
return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
6754667557
}
6754767558
ts.getFirstProjectOutput = getFirstProjectOutput;
@@ -67893,11 +67904,12 @@ var ts;
6789367904
getCompilerOptions: function () { return config.options; },
6789467905
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
6789567906
getNewLine: function () { return host.getNewLine(); },
67896-
getSourceFile: function () { return undefined; },
67897-
getSourceFileByPath: function () { return undefined; },
67907+
getSourceFile: ts.returnUndefined,
67908+
getSourceFileByPath: ts.returnUndefined,
6789867909
getSourceFiles: function () { return sourceFilesForJsEmit; },
6789967910
getLibFileFromReference: ts.notImplemented,
6790067911
isSourceFileFromExternalLibrary: ts.returnFalse,
67912+
getResolvedProjectReferenceToRedirect: ts.returnUndefined,
6790167913
writeFile: function (name, text, writeByteOrderMark) {
6790267914
switch (name) {
6790367915
case jsFilePath:
@@ -67937,7 +67949,7 @@ var ts;
6793767949
fileExists: function (f) { return host.fileExists(f); },
6793867950
directoryExists: host.directoryExists && (function (f) { return host.directoryExists(f); }),
6793967951
useCaseSensitiveFileNames: function () { return host.useCaseSensitiveFileNames(); },
67940-
getProgramBuildInfo: function () { return undefined; }
67952+
getProgramBuildInfo: ts.returnUndefined
6794167953
};
6794267954
emitFiles(ts.notImplementedResolver, emitHost, undefined, false, ts.getTransformers(config.options));
6794367955
return outputFiles;
@@ -72496,7 +72508,7 @@ var ts;
7249672508
}
7249772509
function getCommonSourceDirectory() {
7249872510
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); });
7250072512
if (options.rootDir && checkSourceFilesBelongToPath(emittedFiles, options.rootDir)) {
7250172513
commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, currentDirectory);
7250272514
}
@@ -72793,7 +72805,8 @@ var ts;
7279372805
}
7279472806
function getEmitHost(writeFileCallback) {
7279572807
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) {
7279772810
var path = toPath(f);
7279872811
if (getSourceFileByPath(path))
7279972812
return true;
@@ -73788,14 +73801,15 @@ var ts;
7378873801
}
7378973802
verifyProjectReferences();
7379073803
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));
7379973813
}
7380073814
}
7380173815
}
@@ -74132,7 +74146,7 @@ var ts;
7413274146
readFile: function (f) { return directoryStructureHost.readFile(f); },
7413374147
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
7413474148
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
74135-
onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || (function () { return undefined; }),
74149+
onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || ts.returnUndefined,
7413674150
trace: host.trace ? function (s) { return host.trace(s); } : undefined
7413774151
};
7413874152
}
@@ -75130,7 +75144,7 @@ var ts;
7513075144
backupState: ts.noop,
7513175145
restoreState: ts.noop,
7513275146
getProgram: ts.notImplemented,
75133-
getProgramOrUndefined: function () { return undefined; },
75147+
getProgramOrUndefined: ts.returnUndefined,
7513475148
releaseProgram: ts.noop,
7513575149
getCompilerOptions: function () { return state.compilerOptions; },
7513675150
getSourceFile: ts.notImplemented,
@@ -76855,7 +76869,7 @@ var ts;
7685576869
ts.createBuilderStatusReporter = createBuilderStatusReporter;
7685676870
function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) {
7685776871
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;
7685976873
host.setModifiedTime = system.setModifiedTime ? function (path, date) { return system.setModifiedTime(path, date); } : ts.noop;
7686076874
host.deleteFile = system.deleteFile ? function (path) { return system.deleteFile(path); } : ts.noop;
7686176875
host.reportDiagnostic = reportDiagnostic || ts.createDiagnosticReporter(system);
@@ -77094,12 +77108,12 @@ var ts;
7709477108
newestInputFileTime = inputTime;
7709577109
}
7709677110
}
77097-
var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
77098-
if (outputs.length === 0) {
77111+
if (!project.fileNames.length && !ts.canJsonReportNoInutFiles(project.raw)) {
7709977112
return {
7710077113
type: UpToDateStatusType.ContainerOnly
7710177114
};
7710277115
}
77116+
var outputs = ts.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
7710377117
var oldestOutputFileName = "(none)";
7710477118
var oldestOutputFileTime = maximumDate;
7710577119
var newestOutputFileName = "(none)";

0 commit comments

Comments
 (0)