typescript 4.6.0-dev.20211204 → 4.6.0-dev.20211208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +1 -1
- package/lib/tsc.js +94 -21
- package/lib/tsserver.js +101 -25
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +101 -25
- package/lib/typescript.d.ts +5 -1
- package/lib/typescript.js +101 -25
- package/lib/typescriptServices.d.ts +5 -1
- package/lib/typescriptServices.js +101 -25
- package/lib/typingsInstaller.js +96 -22
- package/package.json +1 -1
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211208";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8131,7 +8131,7 @@ var ts;
|
|
|
8131
8131
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
8132
8132
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
8133
8133
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
8134
|
-
|
|
8134
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
8135
8135
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
8136
8136
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
8137
8137
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -9083,6 +9083,7 @@ var ts;
|
|
|
9083
9083
|
DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
|
|
9084
9084
|
STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
|
|
9085
9085
|
FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
|
|
9086
|
+
Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
|
|
9086
9087
|
Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
|
|
9087
9088
|
Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
|
|
9088
9089
|
Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
|
|
@@ -9276,6 +9277,9 @@ var ts;
|
|
|
9276
9277
|
Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
|
|
9277
9278
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
9278
9279
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
9280
|
+
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
9281
|
+
Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
|
|
9282
|
+
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
9279
9283
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
9280
9284
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
9281
9285
|
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
@@ -33814,10 +33818,14 @@ var ts;
|
|
|
33814
33818
|
// - "(x,y)" is a comma expression parsed as a signature with two parameters.
|
|
33815
33819
|
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
|
|
33816
33820
|
// - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
|
|
33817
|
-
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
|
|
33821
|
+
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
|
|
33818
33822
|
//
|
|
33819
33823
|
// So we need just a bit of lookahead to ensure that it can only be a signature.
|
|
33820
|
-
var
|
|
33824
|
+
var unwrappedType = type;
|
|
33825
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
|
|
33826
|
+
unwrappedType = unwrappedType.type; // Skip parens if need be
|
|
33827
|
+
}
|
|
33828
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
33821
33829
|
if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
|
|
33822
33830
|
// Returning undefined here will cause our caller to rewind to where we started from.
|
|
33823
33831
|
return undefined;
|
|
@@ -41659,7 +41667,10 @@ var ts;
|
|
|
41659
41667
|
}
|
|
41660
41668
|
}
|
|
41661
41669
|
var failedLookupLocations = [];
|
|
41662
|
-
var
|
|
41670
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
41671
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
41672
|
+
NodeResolutionFeatures.None;
|
|
41673
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
41663
41674
|
var resolved = primaryLookup();
|
|
41664
41675
|
var primary = true;
|
|
41665
41676
|
if (!resolved) {
|
|
@@ -42334,13 +42345,15 @@ var ts;
|
|
|
42334
42345
|
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
|
|
42335
42346
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
42336
42347
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
42348
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
42349
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
42337
42350
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
42338
42351
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
42339
42352
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42340
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42353
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42341
42354
|
}
|
|
42342
42355
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42343
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42356
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42344
42357
|
}
|
|
42345
42358
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42346
42359
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -45143,10 +45156,6 @@ var ts;
|
|
|
45143
45156
|
seen.set(identifier.escapedText, currentKind);
|
|
45144
45157
|
continue;
|
|
45145
45158
|
}
|
|
45146
|
-
if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
|
|
45147
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
45148
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
45149
|
-
}
|
|
45150
45159
|
}
|
|
45151
45160
|
}
|
|
45152
45161
|
return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
|
|
@@ -45380,7 +45389,7 @@ var ts;
|
|
|
45380
45389
|
}
|
|
45381
45390
|
}
|
|
45382
45391
|
function checkStrictModeNumericLiteral(node) {
|
|
45383
|
-
if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45392
|
+
if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45384
45393
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
45385
45394
|
}
|
|
45386
45395
|
}
|
|
@@ -48985,10 +48994,12 @@ var ts;
|
|
|
48985
48994
|
}
|
|
48986
48995
|
/* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
|
|
48987
48996
|
* If at any point current node is equal to 'parent' node - return true.
|
|
48997
|
+
* If current node is an IIFE, continue walking up.
|
|
48988
48998
|
* Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
|
|
48989
48999
|
*/
|
|
48990
49000
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
48991
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
49001
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
49002
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
48992
49003
|
}
|
|
48993
49004
|
function getAnyImportSyntax(node) {
|
|
48994
49005
|
switch (node.kind) {
|
|
@@ -65770,7 +65781,7 @@ var ts;
|
|
|
65770
65781
|
}
|
|
65771
65782
|
function getBaseTypeOfLiteralType(type) {
|
|
65772
65783
|
return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
|
|
65773
|
-
type.flags & 128 /* StringLiteral */ ? stringType :
|
|
65784
|
+
type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
|
|
65774
65785
|
type.flags & 256 /* NumberLiteral */ ? numberType :
|
|
65775
65786
|
type.flags & 2048 /* BigIntLiteral */ ? bigintType :
|
|
65776
65787
|
type.flags & 512 /* BooleanLiteral */ ? booleanType :
|
|
@@ -86138,9 +86149,12 @@ var ts;
|
|
|
86138
86149
|
seen.set(effectiveName, currentKind);
|
|
86139
86150
|
}
|
|
86140
86151
|
else {
|
|
86141
|
-
if ((currentKind &
|
|
86152
|
+
if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
|
|
86142
86153
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
86143
86154
|
}
|
|
86155
|
+
else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
|
|
86156
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
86157
|
+
}
|
|
86144
86158
|
else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
|
|
86145
86159
|
if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
|
|
86146
86160
|
seen.set(effectiveName, currentKind | existingKind);
|
|
@@ -119909,7 +119923,7 @@ var ts;
|
|
|
119909
119923
|
getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
|
|
119910
119924
|
} : undefined;
|
|
119911
119925
|
/**
|
|
119912
|
-
* Create a function that reports error by writing to the system and handles the
|
|
119926
|
+
* Create a function that reports error by writing to the system and handles the formatting of the diagnostic
|
|
119913
119927
|
*/
|
|
119914
119928
|
function createDiagnosticReporter(system, pretty) {
|
|
119915
119929
|
var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
|
|
@@ -119995,19 +120009,74 @@ var ts;
|
|
|
119995
120009
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
119996
120010
|
}
|
|
119997
120011
|
ts.getErrorCountForSummary = getErrorCountForSummary;
|
|
120012
|
+
function getFilesInErrorForSummary(diagnostics) {
|
|
120013
|
+
var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
|
|
120014
|
+
.map(function (errorDiagnostic) {
|
|
120015
|
+
if (errorDiagnostic.file === undefined)
|
|
120016
|
+
return;
|
|
120017
|
+
return "" + errorDiagnostic.file.fileName;
|
|
120018
|
+
});
|
|
120019
|
+
return filesInError.map(function (fileName) {
|
|
120020
|
+
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
120021
|
+
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
120022
|
+
});
|
|
120023
|
+
if (diagnosticForFileName !== undefined) {
|
|
120024
|
+
var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
|
|
120025
|
+
return {
|
|
120026
|
+
fileName: fileName,
|
|
120027
|
+
line: line + 1,
|
|
120028
|
+
};
|
|
120029
|
+
}
|
|
120030
|
+
});
|
|
120031
|
+
}
|
|
120032
|
+
ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
|
|
119998
120033
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
119999
120034
|
return errorCount === 1 ?
|
|
120000
120035
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
120001
120036
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
120002
120037
|
}
|
|
120003
120038
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
120004
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
120039
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
120005
120040
|
if (errorCount === 0)
|
|
120006
120041
|
return "";
|
|
120007
|
-
var
|
|
120008
|
-
|
|
120042
|
+
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120043
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
120044
|
+
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120045
|
+
var d = errorCount === 1 ?
|
|
120046
|
+
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
120047
|
+
ts.Diagnostics.Found_1_error_in_1 :
|
|
120048
|
+
ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
|
|
120049
|
+
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
120050
|
+
ts.Diagnostics.Found_0_errors :
|
|
120051
|
+
distinctFileNamesWithLines.length === 1 ?
|
|
120052
|
+
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
120053
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
120054
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
120009
120055
|
}
|
|
120010
120056
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120057
|
+
function createTabularErrorsDisplay(filesInError) {
|
|
120058
|
+
var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
|
|
120059
|
+
if (distinctFiles.length === 0)
|
|
120060
|
+
return "";
|
|
120061
|
+
var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
|
|
120062
|
+
var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
|
|
120063
|
+
var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
|
|
120064
|
+
var headerRow = ts.Diagnostics.Errors_Files.message;
|
|
120065
|
+
var leftColumnHeadingLength = headerRow.split(" ")[0].length;
|
|
120066
|
+
var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
|
|
120067
|
+
var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
|
|
120068
|
+
var tabularData = "";
|
|
120069
|
+
tabularData += " ".repeat(headerPadding) + headerRow + "\n";
|
|
120070
|
+
fileToErrorCount.forEach(function (row) {
|
|
120071
|
+
var file = row[0], errorCount = row[1];
|
|
120072
|
+
var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
|
|
120073
|
+
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
120074
|
+
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120075
|
+
: "";
|
|
120076
|
+
tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
|
|
120077
|
+
});
|
|
120078
|
+
return tabularData;
|
|
120079
|
+
}
|
|
120011
120080
|
function isBuilderProgram(program) {
|
|
120012
120081
|
return !!program.getState;
|
|
120013
120082
|
}
|
|
@@ -120211,7 +120280,7 @@ var ts;
|
|
|
120211
120280
|
listFiles(program, write);
|
|
120212
120281
|
}
|
|
120213
120282
|
if (reportSummary) {
|
|
120214
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
120283
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
120215
120284
|
}
|
|
120216
120285
|
return {
|
|
120217
120286
|
emitResult: emitResult,
|
|
@@ -120422,7 +120491,7 @@ var ts;
|
|
|
120422
120491
|
var system = input.system || ts.sys;
|
|
120423
120492
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
120424
120493
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
120425
|
-
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
|
|
120494
|
+
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
|
|
120426
120495
|
if (input.afterProgramEmitAndDiagnostics)
|
|
120427
120496
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
120428
120497
|
return exitStatus;
|
|
@@ -122641,11 +122710,14 @@ var ts;
|
|
|
122641
122710
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
122642
122711
|
var diagnostics = state.diagnostics;
|
|
122643
122712
|
var totalErrors = 0;
|
|
122713
|
+
var filesInError = [];
|
|
122644
122714
|
if (isCircularBuildOrder(buildOrder)) {
|
|
122645
122715
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
122646
122716
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
122647
122717
|
if (canReportSummary)
|
|
122648
122718
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
122719
|
+
if (canReportSummary)
|
|
122720
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
122649
122721
|
}
|
|
122650
122722
|
else {
|
|
122651
122723
|
// Report errors from the other projects
|
|
@@ -122657,12 +122729,14 @@ var ts;
|
|
|
122657
122729
|
});
|
|
122658
122730
|
if (canReportSummary)
|
|
122659
122731
|
diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
|
|
122732
|
+
if (canReportSummary)
|
|
122733
|
+
diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
|
|
122660
122734
|
}
|
|
122661
122735
|
if (state.watch) {
|
|
122662
122736
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
122663
122737
|
}
|
|
122664
122738
|
else if (state.host.reportErrorSummary) {
|
|
122665
|
-
state.host.reportErrorSummary(totalErrors);
|
|
122739
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
122666
122740
|
}
|
|
122667
122741
|
}
|
|
122668
122742
|
/**
|
|
@@ -131727,8 +131801,10 @@ var ts;
|
|
|
131727
131801
|
}
|
|
131728
131802
|
/** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
|
|
131729
131803
|
function getJsDocTagAtPosition(node, position) {
|
|
131730
|
-
|
|
131731
|
-
|
|
131804
|
+
return ts.findAncestor(node, function (n) {
|
|
131805
|
+
return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
|
|
131806
|
+
ts.isJSDoc(n) ? "quit" : false;
|
|
131807
|
+
});
|
|
131732
131808
|
}
|
|
131733
131809
|
function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
|
|
131734
131810
|
var hasCompletionsType = completionsType && completionsType !== contextualType;
|
|
@@ -141484,7 +141560,7 @@ var ts;
|
|
|
141484
141560
|
displayParts.push(ts.spacePart());
|
|
141485
141561
|
displayParts.push(ts.operatorPart(63 /* EqualsToken */));
|
|
141486
141562
|
displayParts.push(ts.spacePart());
|
|
141487
|
-
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
|
|
141563
|
+
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
|
|
141488
141564
|
}
|
|
141489
141565
|
if (symbolFlags & 384 /* Enum */) {
|
|
141490
141566
|
prefixNextMeaning();
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211208";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -7926,7 +7926,7 @@ var ts;
|
|
|
7926
7926
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
7927
7927
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
7928
7928
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
7929
|
-
|
|
7929
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
7930
7930
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
7931
7931
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
7932
7932
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -8878,6 +8878,7 @@ var ts;
|
|
|
8878
8878
|
DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
|
|
8879
8879
|
STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
|
|
8880
8880
|
FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
|
|
8881
|
+
Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
|
|
8881
8882
|
Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
|
|
8882
8883
|
Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
|
|
8883
8884
|
Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
|
|
@@ -9071,6 +9072,9 @@ var ts;
|
|
|
9071
9072
|
Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
|
|
9072
9073
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
9073
9074
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
9075
|
+
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
9076
|
+
Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
|
|
9077
|
+
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
9074
9078
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
9075
9079
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
9076
9080
|
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
@@ -33609,10 +33613,14 @@ var ts;
|
|
|
33609
33613
|
// - "(x,y)" is a comma expression parsed as a signature with two parameters.
|
|
33610
33614
|
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
|
|
33611
33615
|
// - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
|
|
33612
|
-
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
|
|
33616
|
+
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
|
|
33613
33617
|
//
|
|
33614
33618
|
// So we need just a bit of lookahead to ensure that it can only be a signature.
|
|
33615
|
-
var
|
|
33619
|
+
var unwrappedType = type;
|
|
33620
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
|
|
33621
|
+
unwrappedType = unwrappedType.type; // Skip parens if need be
|
|
33622
|
+
}
|
|
33623
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
33616
33624
|
if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
|
|
33617
33625
|
// Returning undefined here will cause our caller to rewind to where we started from.
|
|
33618
33626
|
return undefined;
|
|
@@ -41454,7 +41462,10 @@ var ts;
|
|
|
41454
41462
|
}
|
|
41455
41463
|
}
|
|
41456
41464
|
var failedLookupLocations = [];
|
|
41457
|
-
var
|
|
41465
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
41466
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
41467
|
+
NodeResolutionFeatures.None;
|
|
41468
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
41458
41469
|
var resolved = primaryLookup();
|
|
41459
41470
|
var primary = true;
|
|
41460
41471
|
if (!resolved) {
|
|
@@ -42129,13 +42140,15 @@ var ts;
|
|
|
42129
42140
|
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
|
|
42130
42141
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
42131
42142
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
42143
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
42144
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
42132
42145
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
42133
42146
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
42134
42147
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42135
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42148
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42136
42149
|
}
|
|
42137
42150
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42138
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42151
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42139
42152
|
}
|
|
42140
42153
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42141
42154
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -44938,10 +44951,6 @@ var ts;
|
|
|
44938
44951
|
seen.set(identifier.escapedText, currentKind);
|
|
44939
44952
|
continue;
|
|
44940
44953
|
}
|
|
44941
|
-
if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
|
|
44942
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
44943
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
44944
|
-
}
|
|
44945
44954
|
}
|
|
44946
44955
|
}
|
|
44947
44956
|
return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
|
|
@@ -45175,7 +45184,7 @@ var ts;
|
|
|
45175
45184
|
}
|
|
45176
45185
|
}
|
|
45177
45186
|
function checkStrictModeNumericLiteral(node) {
|
|
45178
|
-
if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45187
|
+
if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45179
45188
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
45180
45189
|
}
|
|
45181
45190
|
}
|
|
@@ -48780,10 +48789,12 @@ var ts;
|
|
|
48780
48789
|
}
|
|
48781
48790
|
/* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
|
|
48782
48791
|
* If at any point current node is equal to 'parent' node - return true.
|
|
48792
|
+
* If current node is an IIFE, continue walking up.
|
|
48783
48793
|
* Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
|
|
48784
48794
|
*/
|
|
48785
48795
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
48786
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
48796
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
48797
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
48787
48798
|
}
|
|
48788
48799
|
function getAnyImportSyntax(node) {
|
|
48789
48800
|
switch (node.kind) {
|
|
@@ -65565,7 +65576,7 @@ var ts;
|
|
|
65565
65576
|
}
|
|
65566
65577
|
function getBaseTypeOfLiteralType(type) {
|
|
65567
65578
|
return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
|
|
65568
|
-
type.flags & 128 /* StringLiteral */ ? stringType :
|
|
65579
|
+
type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
|
|
65569
65580
|
type.flags & 256 /* NumberLiteral */ ? numberType :
|
|
65570
65581
|
type.flags & 2048 /* BigIntLiteral */ ? bigintType :
|
|
65571
65582
|
type.flags & 512 /* BooleanLiteral */ ? booleanType :
|
|
@@ -85933,9 +85944,12 @@ var ts;
|
|
|
85933
85944
|
seen.set(effectiveName, currentKind);
|
|
85934
85945
|
}
|
|
85935
85946
|
else {
|
|
85936
|
-
if ((currentKind &
|
|
85947
|
+
if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
|
|
85937
85948
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
85938
85949
|
}
|
|
85950
|
+
else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
|
|
85951
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
85952
|
+
}
|
|
85939
85953
|
else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
|
|
85940
85954
|
if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
|
|
85941
85955
|
seen.set(effectiveName, currentKind | existingKind);
|
|
@@ -119704,7 +119718,7 @@ var ts;
|
|
|
119704
119718
|
getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
|
|
119705
119719
|
} : undefined;
|
|
119706
119720
|
/**
|
|
119707
|
-
* Create a function that reports error by writing to the system and handles the
|
|
119721
|
+
* Create a function that reports error by writing to the system and handles the formatting of the diagnostic
|
|
119708
119722
|
*/
|
|
119709
119723
|
function createDiagnosticReporter(system, pretty) {
|
|
119710
119724
|
var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
|
|
@@ -119790,19 +119804,74 @@ var ts;
|
|
|
119790
119804
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
119791
119805
|
}
|
|
119792
119806
|
ts.getErrorCountForSummary = getErrorCountForSummary;
|
|
119807
|
+
function getFilesInErrorForSummary(diagnostics) {
|
|
119808
|
+
var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
|
|
119809
|
+
.map(function (errorDiagnostic) {
|
|
119810
|
+
if (errorDiagnostic.file === undefined)
|
|
119811
|
+
return;
|
|
119812
|
+
return "" + errorDiagnostic.file.fileName;
|
|
119813
|
+
});
|
|
119814
|
+
return filesInError.map(function (fileName) {
|
|
119815
|
+
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
119816
|
+
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
119817
|
+
});
|
|
119818
|
+
if (diagnosticForFileName !== undefined) {
|
|
119819
|
+
var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
|
|
119820
|
+
return {
|
|
119821
|
+
fileName: fileName,
|
|
119822
|
+
line: line + 1,
|
|
119823
|
+
};
|
|
119824
|
+
}
|
|
119825
|
+
});
|
|
119826
|
+
}
|
|
119827
|
+
ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
|
|
119793
119828
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
119794
119829
|
return errorCount === 1 ?
|
|
119795
119830
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
119796
119831
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
119797
119832
|
}
|
|
119798
119833
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
119799
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
119834
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
119800
119835
|
if (errorCount === 0)
|
|
119801
119836
|
return "";
|
|
119802
|
-
var
|
|
119803
|
-
|
|
119837
|
+
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
119838
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
119839
|
+
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
119840
|
+
var d = errorCount === 1 ?
|
|
119841
|
+
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
119842
|
+
ts.Diagnostics.Found_1_error_in_1 :
|
|
119843
|
+
ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
|
|
119844
|
+
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
119845
|
+
ts.Diagnostics.Found_0_errors :
|
|
119846
|
+
distinctFileNamesWithLines.length === 1 ?
|
|
119847
|
+
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
119848
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
119849
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
119804
119850
|
}
|
|
119805
119851
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
119852
|
+
function createTabularErrorsDisplay(filesInError) {
|
|
119853
|
+
var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
|
|
119854
|
+
if (distinctFiles.length === 0)
|
|
119855
|
+
return "";
|
|
119856
|
+
var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
|
|
119857
|
+
var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
|
|
119858
|
+
var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
|
|
119859
|
+
var headerRow = ts.Diagnostics.Errors_Files.message;
|
|
119860
|
+
var leftColumnHeadingLength = headerRow.split(" ")[0].length;
|
|
119861
|
+
var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
|
|
119862
|
+
var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
|
|
119863
|
+
var tabularData = "";
|
|
119864
|
+
tabularData += " ".repeat(headerPadding) + headerRow + "\n";
|
|
119865
|
+
fileToErrorCount.forEach(function (row) {
|
|
119866
|
+
var file = row[0], errorCount = row[1];
|
|
119867
|
+
var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
|
|
119868
|
+
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
119869
|
+
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
119870
|
+
: "";
|
|
119871
|
+
tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
|
|
119872
|
+
});
|
|
119873
|
+
return tabularData;
|
|
119874
|
+
}
|
|
119806
119875
|
function isBuilderProgram(program) {
|
|
119807
119876
|
return !!program.getState;
|
|
119808
119877
|
}
|
|
@@ -120006,7 +120075,7 @@ var ts;
|
|
|
120006
120075
|
listFiles(program, write);
|
|
120007
120076
|
}
|
|
120008
120077
|
if (reportSummary) {
|
|
120009
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
120078
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
120010
120079
|
}
|
|
120011
120080
|
return {
|
|
120012
120081
|
emitResult: emitResult,
|
|
@@ -120217,7 +120286,7 @@ var ts;
|
|
|
120217
120286
|
var system = input.system || ts.sys;
|
|
120218
120287
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
120219
120288
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
120220
|
-
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
|
|
120289
|
+
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
|
|
120221
120290
|
if (input.afterProgramEmitAndDiagnostics)
|
|
120222
120291
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
120223
120292
|
return exitStatus;
|
|
@@ -122436,11 +122505,14 @@ var ts;
|
|
|
122436
122505
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
122437
122506
|
var diagnostics = state.diagnostics;
|
|
122438
122507
|
var totalErrors = 0;
|
|
122508
|
+
var filesInError = [];
|
|
122439
122509
|
if (isCircularBuildOrder(buildOrder)) {
|
|
122440
122510
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
122441
122511
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
122442
122512
|
if (canReportSummary)
|
|
122443
122513
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
122514
|
+
if (canReportSummary)
|
|
122515
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
122444
122516
|
}
|
|
122445
122517
|
else {
|
|
122446
122518
|
// Report errors from the other projects
|
|
@@ -122452,12 +122524,14 @@ var ts;
|
|
|
122452
122524
|
});
|
|
122453
122525
|
if (canReportSummary)
|
|
122454
122526
|
diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
|
|
122527
|
+
if (canReportSummary)
|
|
122528
|
+
diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
|
|
122455
122529
|
}
|
|
122456
122530
|
if (state.watch) {
|
|
122457
122531
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
122458
122532
|
}
|
|
122459
122533
|
else if (state.host.reportErrorSummary) {
|
|
122460
|
-
state.host.reportErrorSummary(totalErrors);
|
|
122534
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
122461
122535
|
}
|
|
122462
122536
|
}
|
|
122463
122537
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.6.0-dev.
|
|
5
|
+
"version": "4.6.0-dev.20211208",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|