typescript 4.6.0-dev.20220119 → 4.6.0-dev.20220123
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.dom.d.ts +1 -1
- package/lib/tsc.js +95 -35
- package/lib/tsserver.js +129 -53
- package/lib/tsserverlibrary.d.ts +3 -3
- package/lib/tsserverlibrary.js +129 -53
- package/lib/typescript.d.ts +3 -3
- package/lib/typescript.js +129 -53
- package/lib/typescriptServices.d.ts +3 -3
- package/lib/typescriptServices.js +129 -53
- package/lib/typingsInstaller.js +106 -35
- package/package.json +2 -2
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.20220123";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -6799,11 +6799,15 @@ var ts;
|
|
|
6799
6799
|
ts.getFileWatcherEventKind = getFileWatcherEventKind;
|
|
6800
6800
|
/*@internal*/
|
|
6801
6801
|
ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
|
|
6802
|
+
var curSysLog = ts.noop; // eslint-disable-line prefer-const
|
|
6802
6803
|
/*@internal*/
|
|
6803
|
-
|
|
6804
|
+
function sysLog(s) {
|
|
6805
|
+
return curSysLog(s);
|
|
6806
|
+
}
|
|
6807
|
+
ts.sysLog = sysLog;
|
|
6804
6808
|
/*@internal*/
|
|
6805
6809
|
function setSysLog(logger) {
|
|
6806
|
-
|
|
6810
|
+
curSysLog = logger;
|
|
6807
6811
|
}
|
|
6808
6812
|
ts.setSysLog = setSysLog;
|
|
6809
6813
|
/**
|
|
@@ -6938,7 +6942,7 @@ var ts;
|
|
|
6938
6942
|
}
|
|
6939
6943
|
function onTimerToUpdateChildWatches() {
|
|
6940
6944
|
timerToUpdateChildWatches = undefined;
|
|
6941
|
-
|
|
6945
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
6942
6946
|
var start = ts.timestamp();
|
|
6943
6947
|
var invokeMap = new ts.Map();
|
|
6944
6948
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6951,7 +6955,7 @@ var ts;
|
|
|
6951
6955
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6952
6956
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6953
6957
|
}
|
|
6954
|
-
|
|
6958
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
6955
6959
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6956
6960
|
var existing = invokeMap.get(rootDirName);
|
|
6957
6961
|
if (existing) {
|
|
@@ -6967,7 +6971,7 @@ var ts;
|
|
|
6967
6971
|
}
|
|
6968
6972
|
});
|
|
6969
6973
|
var elapsed = ts.timestamp() - start;
|
|
6970
|
-
|
|
6974
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
6971
6975
|
}
|
|
6972
6976
|
function removeChildWatches(parentWatcher) {
|
|
6973
6977
|
if (!parentWatcher)
|
|
@@ -7554,7 +7558,7 @@ var ts;
|
|
|
7554
7558
|
* @param createWatcher
|
|
7555
7559
|
*/
|
|
7556
7560
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
7557
|
-
|
|
7561
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
7558
7562
|
// Call the callback for current directory
|
|
7559
7563
|
callback("rename", "");
|
|
7560
7564
|
// If watcher is not closed, update it
|
|
@@ -7579,7 +7583,7 @@ var ts;
|
|
|
7579
7583
|
}
|
|
7580
7584
|
}
|
|
7581
7585
|
if (hitSystemWatcherLimit) {
|
|
7582
|
-
|
|
7586
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
7583
7587
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7584
7588
|
}
|
|
7585
7589
|
try {
|
|
@@ -7595,7 +7599,7 @@ var ts;
|
|
|
7595
7599
|
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
7596
7600
|
// so instead of throwing error, use fs.watchFile
|
|
7597
7601
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
7598
|
-
|
|
7602
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
7599
7603
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7600
7604
|
}
|
|
7601
7605
|
}
|
|
@@ -8194,6 +8198,7 @@ var ts;
|
|
|
8194
8198
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
8195
8199
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8196
8200
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8201
|
+
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
8197
8202
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8198
8203
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8199
8204
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -8681,6 +8686,7 @@ var ts;
|
|
|
8681
8686
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
|
|
8682
8687
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
|
|
8683
8688
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
8689
|
+
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8684
8690
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8685
8691
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8686
8692
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -9074,7 +9080,7 @@ var ts;
|
|
|
9074
9080
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
9075
9081
|
_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"),
|
|
9076
9082
|
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
9077
|
-
|
|
9083
|
+
Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
|
|
9078
9084
|
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
9079
9085
|
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."),
|
|
9080
9086
|
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}'."),
|
|
@@ -15847,7 +15853,7 @@ var ts;
|
|
|
15847
15853
|
}
|
|
15848
15854
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
15849
15855
|
function getExternalModuleRequireArgument(node) {
|
|
15850
|
-
return
|
|
15856
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
15851
15857
|
}
|
|
15852
15858
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
15853
15859
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -15905,17 +15911,29 @@ var ts;
|
|
|
15905
15911
|
* Returns true if the node is a VariableDeclaration initialized to a require call (see `isRequireCall`).
|
|
15906
15912
|
* This function does not test if the node is in a JavaScript file or not.
|
|
15907
15913
|
*/
|
|
15908
|
-
function
|
|
15914
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
15915
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ false);
|
|
15916
|
+
}
|
|
15917
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
15918
|
+
/**
|
|
15919
|
+
* Like {@link isVariableDeclarationInitializedToRequire} but allows things like `require("...").foo.bar` or `require("...")["baz"]`.
|
|
15920
|
+
*/
|
|
15921
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
15922
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ true);
|
|
15923
|
+
}
|
|
15924
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
15925
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
15909
15926
|
if (node.kind === 202 /* BindingElement */) {
|
|
15910
15927
|
node = node.parent.parent;
|
|
15911
15928
|
}
|
|
15912
|
-
return ts.isVariableDeclaration(node) &&
|
|
15929
|
+
return ts.isVariableDeclaration(node) &&
|
|
15930
|
+
!!node.initializer &&
|
|
15931
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, /*requireStringLiteralLikeArgument*/ true);
|
|
15913
15932
|
}
|
|
15914
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
15915
15933
|
function isRequireVariableStatement(node) {
|
|
15916
15934
|
return ts.isVariableStatement(node)
|
|
15917
15935
|
&& node.declarationList.declarations.length > 0
|
|
15918
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
15936
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
15919
15937
|
}
|
|
15920
15938
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
15921
15939
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -19402,7 +19420,7 @@ var ts;
|
|
|
19402
19420
|
getSourceMapSourceConstructor: function () { return SourceMapSource; },
|
|
19403
19421
|
};
|
|
19404
19422
|
function setObjectAllocator(alloc) {
|
|
19405
|
-
ts.objectAllocator
|
|
19423
|
+
Object.assign(ts.objectAllocator, alloc);
|
|
19406
19424
|
}
|
|
19407
19425
|
ts.setObjectAllocator = setObjectAllocator;
|
|
19408
19426
|
function formatStringFromArgs(text, args, baseIndex) {
|
|
@@ -19410,13 +19428,22 @@ var ts;
|
|
|
19410
19428
|
return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
|
|
19411
19429
|
}
|
|
19412
19430
|
ts.formatStringFromArgs = formatStringFromArgs;
|
|
19431
|
+
var localizedDiagnosticMessages;
|
|
19413
19432
|
/* @internal */
|
|
19414
19433
|
function setLocalizedDiagnosticMessages(messages) {
|
|
19415
|
-
|
|
19434
|
+
localizedDiagnosticMessages = messages;
|
|
19416
19435
|
}
|
|
19417
19436
|
ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
|
|
19437
|
+
/* @internal */
|
|
19438
|
+
// If the localized messages json is unset, and if given function use it to set the json
|
|
19439
|
+
function maybeSetLocalizedDiagnosticMessages(getMessages) {
|
|
19440
|
+
if (!localizedDiagnosticMessages && getMessages) {
|
|
19441
|
+
localizedDiagnosticMessages = getMessages();
|
|
19442
|
+
}
|
|
19443
|
+
}
|
|
19444
|
+
ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
|
|
19418
19445
|
function getLocaleSpecificMessage(message) {
|
|
19419
|
-
return
|
|
19446
|
+
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
19420
19447
|
}
|
|
19421
19448
|
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
|
19422
19449
|
function createDetachedDiagnostic(fileName, start, length, message) {
|
|
@@ -35025,7 +35052,7 @@ var ts;
|
|
|
35025
35052
|
// one out no matter what.
|
|
35026
35053
|
var finallyBlock;
|
|
35027
35054
|
if (!catchClause || token() === 96 /* FinallyKeyword */) {
|
|
35028
|
-
parseExpected(96 /* FinallyKeyword
|
|
35055
|
+
parseExpected(96 /* FinallyKeyword */, ts.Diagnostics.catch_or_finally_expected);
|
|
35029
35056
|
finallyBlock = parseBlock(/*ignoreMissingOpenBrace*/ false);
|
|
35030
35057
|
}
|
|
35031
35058
|
return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
|
|
@@ -36069,7 +36096,7 @@ var ts;
|
|
|
36069
36096
|
var pos = getNodePos();
|
|
36070
36097
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */);
|
|
36071
36098
|
parseExpected(58 /* ColonToken */);
|
|
36072
|
-
var value =
|
|
36099
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
36073
36100
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
36074
36101
|
}
|
|
36075
36102
|
function parseAssertClause() {
|
|
@@ -45417,6 +45444,8 @@ var ts;
|
|
|
45417
45444
|
return;
|
|
45418
45445
|
}
|
|
45419
45446
|
ts.setParent(node, parent);
|
|
45447
|
+
if (ts.tracing)
|
|
45448
|
+
node.tracingPath = file.path;
|
|
45420
45449
|
var saveInStrictMode = inStrictMode;
|
|
45421
45450
|
// Even though in the AST the jsdoc @typedef node belongs to the current node,
|
|
45422
45451
|
// its symbol might be in the same scope with the current node's symbol. Consider:
|
|
@@ -46237,7 +46266,7 @@ var ts;
|
|
|
46237
46266
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
46238
46267
|
}
|
|
46239
46268
|
if (!ts.isBindingPattern(node.name)) {
|
|
46240
|
-
if (ts.isInJSFile(node) && ts.
|
|
46269
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
46241
46270
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
46242
46271
|
}
|
|
46243
46272
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -46748,6 +46777,9 @@ var ts;
|
|
|
46748
46777
|
TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
|
|
46749
46778
|
TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
|
|
46750
46779
|
TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
|
|
46780
|
+
// Masks
|
|
46781
|
+
TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
|
|
46782
|
+
TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
|
|
46751
46783
|
})(TypeFacts || (TypeFacts = {}));
|
|
46752
46784
|
var typeofEQFacts = new ts.Map(ts.getEntries({
|
|
46753
46785
|
string: 1 /* TypeofEQString */,
|
|
@@ -49020,7 +49052,7 @@ var ts;
|
|
|
49020
49052
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
49021
49053
|
|| node.kind === 295 /* ShorthandPropertyAssignment */
|
|
49022
49054
|
|| node.kind === 294 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
|
|
49023
|
-
|| ts.
|
|
49055
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
49024
49056
|
}
|
|
49025
49057
|
function isAliasableOrJsExpression(e) {
|
|
49026
49058
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -49808,8 +49840,14 @@ var ts;
|
|
|
49808
49840
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
49809
49841
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
49810
49842
|
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
49811
|
-
var sourceFile = resolvedModule
|
|
49843
|
+
var sourceFile = resolvedModule
|
|
49844
|
+
&& (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
|
|
49845
|
+
&& host.getSourceFile(resolvedModule.resolvedFileName);
|
|
49812
49846
|
if (sourceFile) {
|
|
49847
|
+
// If there's a resolutionDiagnostic we need to report it even if a sourceFile is found.
|
|
49848
|
+
if (resolutionDiagnostic) {
|
|
49849
|
+
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
49850
|
+
}
|
|
49813
49851
|
if (sourceFile.symbol) {
|
|
49814
49852
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
49815
49853
|
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
|
|
@@ -67883,10 +67921,23 @@ var ts;
|
|
|
67883
67921
|
// When an intersection contains a primitive type we ignore object type constituents as they are
|
|
67884
67922
|
// presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
|
|
67885
67923
|
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
|
|
67886
|
-
return
|
|
67924
|
+
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
67887
67925
|
}
|
|
67888
67926
|
return 16777215 /* All */;
|
|
67889
67927
|
}
|
|
67928
|
+
function getIntersectionTypeFacts(type, ignoreObjects) {
|
|
67929
|
+
// When computing the type facts of an intersection type, certain type facts are computed as `and`
|
|
67930
|
+
// and others are computed as `or`.
|
|
67931
|
+
var oredFacts = 0 /* None */;
|
|
67932
|
+
var andedFacts = 16777215 /* All */;
|
|
67933
|
+
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
67934
|
+
var t = _a[_i];
|
|
67935
|
+
var f = getTypeFacts(t, ignoreObjects);
|
|
67936
|
+
oredFacts |= f;
|
|
67937
|
+
andedFacts &= f;
|
|
67938
|
+
}
|
|
67939
|
+
return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
|
|
67940
|
+
}
|
|
67890
67941
|
function getTypeWithFacts(type, include) {
|
|
67891
67942
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
67892
67943
|
}
|
|
@@ -77898,7 +77949,7 @@ var ts;
|
|
|
77898
77949
|
}
|
|
77899
77950
|
}
|
|
77900
77951
|
function checkExpression(node, checkMode, forceTuple) {
|
|
77901
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
|
|
77952
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
77902
77953
|
var saveCurrentNode = currentNode;
|
|
77903
77954
|
currentNode = node;
|
|
77904
77955
|
instantiationCount = 0;
|
|
@@ -80579,7 +80630,7 @@ var ts;
|
|
|
80579
80630
|
}
|
|
80580
80631
|
// For a commonjs `const x = require`, validate the alias and exit
|
|
80581
80632
|
var symbol = getSymbolOfNode(node);
|
|
80582
|
-
if (symbol.flags & 2097152 /* Alias */ && ts.
|
|
80633
|
+
if (symbol.flags & 2097152 /* Alias */ && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
80583
80634
|
checkAliasSymbol(node);
|
|
80584
80635
|
return;
|
|
80585
80636
|
}
|
|
@@ -80657,7 +80708,7 @@ var ts;
|
|
|
80657
80708
|
return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
80658
80709
|
}
|
|
80659
80710
|
function checkVariableDeclaration(node) {
|
|
80660
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
|
|
80711
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
80661
80712
|
checkGrammarVariableDeclaration(node);
|
|
80662
80713
|
checkVariableLikeDeclaration(node);
|
|
80663
80714
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -83047,6 +83098,17 @@ var ts;
|
|
|
83047
83098
|
return false;
|
|
83048
83099
|
}
|
|
83049
83100
|
}
|
|
83101
|
+
if (!ts.isImportEqualsDeclaration(node) && node.assertClause) {
|
|
83102
|
+
var hasError = false;
|
|
83103
|
+
for (var _i = 0, _a = node.assertClause.elements; _i < _a.length; _i++) {
|
|
83104
|
+
var clause = _a[_i];
|
|
83105
|
+
if (!ts.isStringLiteral(clause.value)) {
|
|
83106
|
+
hasError = true;
|
|
83107
|
+
error(clause.value, ts.Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
|
|
83108
|
+
}
|
|
83109
|
+
}
|
|
83110
|
+
return !hasError;
|
|
83111
|
+
}
|
|
83050
83112
|
return true;
|
|
83051
83113
|
}
|
|
83052
83114
|
function checkAliasSymbol(node) {
|
|
@@ -83740,7 +83802,7 @@ var ts;
|
|
|
83740
83802
|
}
|
|
83741
83803
|
}
|
|
83742
83804
|
function checkDeferredNode(node) {
|
|
83743
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
|
|
83805
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check" /* Check */, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
83744
83806
|
var saveCurrentNode = currentNode;
|
|
83745
83807
|
currentNode = node;
|
|
83746
83808
|
instantiationCount = 0;
|
|
@@ -87674,7 +87736,7 @@ var ts;
|
|
|
87674
87736
|
return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
|
|
87675
87737
|
case 293 /* AssertEntry */:
|
|
87676
87738
|
ts.Debug.type(node);
|
|
87677
|
-
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.
|
|
87739
|
+
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isExpressionNode));
|
|
87678
87740
|
case 266 /* ImportClause */:
|
|
87679
87741
|
ts.Debug.type(node);
|
|
87680
87742
|
return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
|
|
@@ -120272,22 +120334,31 @@ var ts;
|
|
|
120272
120334
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
120273
120335
|
}
|
|
120274
120336
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
120337
|
+
function prettyPathForFileError(error, cwd) {
|
|
120338
|
+
var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
|
|
120339
|
+
if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
|
|
120340
|
+
return ts.getRelativePathFromDirectory(cwd, error.fileName, /* ignoreCase */ false) + line;
|
|
120341
|
+
}
|
|
120342
|
+
return error.fileName + line;
|
|
120343
|
+
}
|
|
120275
120344
|
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
120276
120345
|
if (errorCount === 0)
|
|
120277
120346
|
return "";
|
|
120278
120347
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120279
120348
|
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
120280
120349
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120350
|
+
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120281
120351
|
var d = errorCount === 1 ?
|
|
120282
120352
|
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
120283
120353
|
ts.Diagnostics.Found_1_error_in_1 :
|
|
120284
|
-
ts.Diagnostics.Found_1_error, errorCount,
|
|
120354
|
+
ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
|
|
120285
120355
|
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
120286
120356
|
ts.Diagnostics.Found_0_errors :
|
|
120287
120357
|
distinctFileNamesWithLines.length === 1 ?
|
|
120288
|
-
ts.Diagnostics.
|
|
120289
|
-
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
120290
|
-
|
|
120358
|
+
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120359
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120360
|
+
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120361
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
120291
120362
|
}
|
|
120292
120363
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120293
120364
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120309,8 +120380,8 @@ var ts;
|
|
|
120309
120380
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
120310
120381
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120311
120382
|
: "";
|
|
120312
|
-
var
|
|
120313
|
-
tabularData += "" + leftPadding + errorCount + " " +
|
|
120383
|
+
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120384
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
120314
120385
|
});
|
|
120315
120386
|
return tabularData;
|
|
120316
120387
|
}
|
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.20220123",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"q": "latest",
|
|
94
94
|
"source-map-support": "latest",
|
|
95
95
|
"through2": "latest",
|
|
96
|
-
"typescript": "^4.
|
|
96
|
+
"typescript": "^4.5.5",
|
|
97
97
|
"vinyl": "latest",
|
|
98
98
|
"vinyl-sourcemaps-apply": "latest",
|
|
99
99
|
"xml2js": "^0.4.19"
|