typescript 4.6.0-dev.20220118 → 4.6.0-dev.20220122
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 +144 -58
- package/lib/lib.dom.iterable.d.ts +7 -0
- package/lib/lib.es2015.iterable.d.ts +2 -1
- package/lib/lib.es2020.intl.d.ts +4 -0
- package/lib/lib.es5.d.ts +0 -2
- package/lib/lib.webworker.d.ts +80 -17
- package/lib/lib.webworker.iterable.d.ts +7 -0
- package/lib/protocol.d.ts +1 -0
- package/lib/tsc.js +131 -48
- package/lib/tsserver.js +202 -97
- package/lib/tsserverlibrary.d.ts +5 -3
- package/lib/tsserverlibrary.js +202 -97
- package/lib/typescript.d.ts +4 -3
- package/lib/typescript.js +188 -95
- package/lib/typescriptServices.d.ts +4 -3
- package/lib/typescriptServices.js +188 -95
- package/lib/typingsInstaller.js +146 -49
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220122";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -4171,9 +4171,13 @@ var ts;
|
|
|
4171
4171
|
}
|
|
4172
4172
|
ts.getFileWatcherEventKind = getFileWatcherEventKind;
|
|
4173
4173
|
ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
|
|
4174
|
-
|
|
4174
|
+
var curSysLog = ts.noop;
|
|
4175
|
+
function sysLog(s) {
|
|
4176
|
+
return curSysLog(s);
|
|
4177
|
+
}
|
|
4178
|
+
ts.sysLog = sysLog;
|
|
4175
4179
|
function setSysLog(logger) {
|
|
4176
|
-
|
|
4180
|
+
curSysLog = logger;
|
|
4177
4181
|
}
|
|
4178
4182
|
ts.setSysLog = setSysLog;
|
|
4179
4183
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
@@ -4293,7 +4297,7 @@ var ts;
|
|
|
4293
4297
|
}
|
|
4294
4298
|
function onTimerToUpdateChildWatches() {
|
|
4295
4299
|
timerToUpdateChildWatches = undefined;
|
|
4296
|
-
|
|
4300
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
4297
4301
|
var start = ts.timestamp();
|
|
4298
4302
|
var invokeMap = new ts.Map();
|
|
4299
4303
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -4304,7 +4308,7 @@ var ts;
|
|
|
4304
4308
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
4305
4309
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
4306
4310
|
}
|
|
4307
|
-
|
|
4311
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
4308
4312
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
4309
4313
|
var existing = invokeMap.get(rootDirName);
|
|
4310
4314
|
if (existing) {
|
|
@@ -4320,7 +4324,7 @@ var ts;
|
|
|
4320
4324
|
}
|
|
4321
4325
|
});
|
|
4322
4326
|
var elapsed = ts.timestamp() - start;
|
|
4323
|
-
|
|
4327
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
4324
4328
|
}
|
|
4325
4329
|
function removeChildWatches(parentWatcher) {
|
|
4326
4330
|
if (!parentWatcher)
|
|
@@ -4822,7 +4826,7 @@ var ts;
|
|
|
4822
4826
|
}
|
|
4823
4827
|
};
|
|
4824
4828
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
4825
|
-
|
|
4829
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
4826
4830
|
callback("rename", "");
|
|
4827
4831
|
if (watcher) {
|
|
4828
4832
|
watcher.close();
|
|
@@ -4839,7 +4843,7 @@ var ts;
|
|
|
4839
4843
|
}
|
|
4840
4844
|
}
|
|
4841
4845
|
if (hitSystemWatcherLimit) {
|
|
4842
|
-
|
|
4846
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
4843
4847
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4844
4848
|
}
|
|
4845
4849
|
try {
|
|
@@ -4851,7 +4855,7 @@ var ts;
|
|
|
4851
4855
|
}
|
|
4852
4856
|
catch (e) {
|
|
4853
4857
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
4854
|
-
|
|
4858
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
4855
4859
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4856
4860
|
}
|
|
4857
4861
|
}
|
|
@@ -5419,6 +5423,7 @@ var ts;
|
|
|
5419
5423
|
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"),
|
|
5420
5424
|
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."),
|
|
5421
5425
|
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."),
|
|
5426
|
+
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5422
5427
|
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."),
|
|
5423
5428
|
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."),
|
|
5424
5429
|
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.", undefined, true),
|
|
@@ -5906,6 +5911,7 @@ var ts;
|
|
|
5906
5911
|
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."),
|
|
5907
5912
|
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}'?"),
|
|
5908
5913
|
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."),
|
|
5914
|
+
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."),
|
|
5909
5915
|
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}'."),
|
|
5910
5916
|
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}'."),
|
|
5911
5917
|
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}'."),
|
|
@@ -6299,7 +6305,7 @@ var ts;
|
|
|
6299
6305
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
6300
6306
|
_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"),
|
|
6301
6307
|
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
6302
|
-
|
|
6308
|
+
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}"),
|
|
6303
6309
|
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
6304
6310
|
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."),
|
|
6305
6311
|
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}'."),
|
|
@@ -12277,7 +12283,7 @@ var ts;
|
|
|
12277
12283
|
}
|
|
12278
12284
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
12279
12285
|
function getExternalModuleRequireArgument(node) {
|
|
12280
|
-
return
|
|
12286
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
12281
12287
|
}
|
|
12282
12288
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
12283
12289
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -12331,17 +12337,26 @@ var ts;
|
|
|
12331
12337
|
return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
|
|
12332
12338
|
}
|
|
12333
12339
|
ts.isRequireCall = isRequireCall;
|
|
12334
|
-
function
|
|
12340
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
12341
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, false);
|
|
12342
|
+
}
|
|
12343
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
12344
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
12345
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, true);
|
|
12346
|
+
}
|
|
12347
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
12348
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
12335
12349
|
if (node.kind === 202) {
|
|
12336
12350
|
node = node.parent.parent;
|
|
12337
12351
|
}
|
|
12338
|
-
return ts.isVariableDeclaration(node) &&
|
|
12352
|
+
return ts.isVariableDeclaration(node) &&
|
|
12353
|
+
!!node.initializer &&
|
|
12354
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
|
|
12339
12355
|
}
|
|
12340
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
12341
12356
|
function isRequireVariableStatement(node) {
|
|
12342
12357
|
return ts.isVariableStatement(node)
|
|
12343
12358
|
&& node.declarationList.declarations.length > 0
|
|
12344
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
12359
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
12345
12360
|
}
|
|
12346
12361
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
12347
12362
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -15301,7 +15316,7 @@ var ts;
|
|
|
15301
15316
|
getSourceMapSourceConstructor: function () { return SourceMapSource; },
|
|
15302
15317
|
};
|
|
15303
15318
|
function setObjectAllocator(alloc) {
|
|
15304
|
-
ts.objectAllocator
|
|
15319
|
+
Object.assign(ts.objectAllocator, alloc);
|
|
15305
15320
|
}
|
|
15306
15321
|
ts.setObjectAllocator = setObjectAllocator;
|
|
15307
15322
|
function formatStringFromArgs(text, args, baseIndex) {
|
|
@@ -15309,12 +15324,19 @@ var ts;
|
|
|
15309
15324
|
return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
|
|
15310
15325
|
}
|
|
15311
15326
|
ts.formatStringFromArgs = formatStringFromArgs;
|
|
15327
|
+
var localizedDiagnosticMessages;
|
|
15312
15328
|
function setLocalizedDiagnosticMessages(messages) {
|
|
15313
|
-
|
|
15329
|
+
localizedDiagnosticMessages = messages;
|
|
15314
15330
|
}
|
|
15315
15331
|
ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
|
|
15332
|
+
function maybeSetLocalizedDiagnosticMessages(getMessages) {
|
|
15333
|
+
if (!localizedDiagnosticMessages && getMessages) {
|
|
15334
|
+
localizedDiagnosticMessages = getMessages();
|
|
15335
|
+
}
|
|
15336
|
+
}
|
|
15337
|
+
ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
|
|
15316
15338
|
function getLocaleSpecificMessage(message) {
|
|
15317
|
-
return
|
|
15339
|
+
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
15318
15340
|
}
|
|
15319
15341
|
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
|
15320
15342
|
function createDetachedDiagnostic(fileName, start, length, message) {
|
|
@@ -28164,7 +28186,7 @@ var ts;
|
|
|
28164
28186
|
var catchClause = token() === 83 ? parseCatchClause() : undefined;
|
|
28165
28187
|
var finallyBlock;
|
|
28166
28188
|
if (!catchClause || token() === 96) {
|
|
28167
|
-
parseExpected(96);
|
|
28189
|
+
parseExpected(96, ts.Diagnostics.catch_or_finally_expected);
|
|
28168
28190
|
finallyBlock = parseBlock(false);
|
|
28169
28191
|
}
|
|
28170
28192
|
return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
|
|
@@ -29088,7 +29110,7 @@ var ts;
|
|
|
29088
29110
|
var pos = getNodePos();
|
|
29089
29111
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
|
|
29090
29112
|
parseExpected(58);
|
|
29091
|
-
var value =
|
|
29113
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
29092
29114
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
29093
29115
|
}
|
|
29094
29116
|
function parseAssertClause() {
|
|
@@ -36576,22 +36598,27 @@ var ts;
|
|
|
36576
36598
|
}
|
|
36577
36599
|
return state;
|
|
36578
36600
|
}
|
|
36579
|
-
function onLeft(left, state,
|
|
36601
|
+
function onLeft(left, state, node) {
|
|
36580
36602
|
if (!state.skip) {
|
|
36581
|
-
|
|
36603
|
+
var maybeBound = maybeBind(left);
|
|
36604
|
+
if (node.operatorToken.kind === 27) {
|
|
36605
|
+
maybeBindExpressionFlowIfCall(left);
|
|
36606
|
+
}
|
|
36607
|
+
return maybeBound;
|
|
36582
36608
|
}
|
|
36583
36609
|
}
|
|
36584
|
-
function onOperator(operatorToken, state,
|
|
36610
|
+
function onOperator(operatorToken, state, _node) {
|
|
36585
36611
|
if (!state.skip) {
|
|
36586
|
-
if (operatorToken.kind === 27) {
|
|
36587
|
-
maybeBindExpressionFlowIfCall(node.left);
|
|
36588
|
-
}
|
|
36589
36612
|
bind(operatorToken);
|
|
36590
36613
|
}
|
|
36591
36614
|
}
|
|
36592
|
-
function onRight(right, state,
|
|
36615
|
+
function onRight(right, state, node) {
|
|
36593
36616
|
if (!state.skip) {
|
|
36594
|
-
|
|
36617
|
+
var maybeBound = maybeBind(right);
|
|
36618
|
+
if (node.operatorToken.kind === 27) {
|
|
36619
|
+
maybeBindExpressionFlowIfCall(right);
|
|
36620
|
+
}
|
|
36621
|
+
return maybeBound;
|
|
36595
36622
|
}
|
|
36596
36623
|
}
|
|
36597
36624
|
function onExit(node, state) {
|
|
@@ -37222,6 +37249,8 @@ var ts;
|
|
|
37222
37249
|
return;
|
|
37223
37250
|
}
|
|
37224
37251
|
ts.setParent(node, parent);
|
|
37252
|
+
if (ts.tracing)
|
|
37253
|
+
node.tracingPath = file.path;
|
|
37225
37254
|
var saveInStrictMode = inStrictMode;
|
|
37226
37255
|
bindWorker(node);
|
|
37227
37256
|
if (node.kind > 159) {
|
|
@@ -37927,7 +37956,7 @@ var ts;
|
|
|
37927
37956
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
37928
37957
|
}
|
|
37929
37958
|
if (!ts.isBindingPattern(node.name)) {
|
|
37930
|
-
if (ts.isInJSFile(node) && ts.
|
|
37959
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
37931
37960
|
declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
|
|
37932
37961
|
}
|
|
37933
37962
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -40205,7 +40234,7 @@ var ts;
|
|
|
40205
40234
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
40206
40235
|
|| node.kind === 295
|
|
40207
40236
|
|| node.kind === 294 && isAliasableOrJsExpression(node.initializer)
|
|
40208
|
-
|| ts.
|
|
40237
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
40209
40238
|
}
|
|
40210
40239
|
function isAliasableOrJsExpression(e) {
|
|
40211
40240
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -40897,8 +40926,13 @@ var ts;
|
|
|
40897
40926
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
40898
40927
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
40899
40928
|
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
40900
|
-
var sourceFile = resolvedModule
|
|
40929
|
+
var sourceFile = resolvedModule
|
|
40930
|
+
&& (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
|
|
40931
|
+
&& host.getSourceFile(resolvedModule.resolvedFileName);
|
|
40901
40932
|
if (sourceFile) {
|
|
40933
|
+
if (resolutionDiagnostic) {
|
|
40934
|
+
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
40935
|
+
}
|
|
40902
40936
|
if (sourceFile.symbol) {
|
|
40903
40937
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
40904
40938
|
errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
|
|
@@ -41901,6 +41935,7 @@ var ts;
|
|
|
41901
41935
|
getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
|
|
41902
41936
|
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
|
41903
41937
|
getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
|
|
41938
|
+
getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
|
|
41904
41939
|
useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
|
|
41905
41940
|
redirectTargetsMap: host.redirectTargetsMap,
|
|
41906
41941
|
getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
|
|
@@ -56658,10 +56693,21 @@ var ts;
|
|
|
56658
56693
|
}
|
|
56659
56694
|
if (flags & 2097152) {
|
|
56660
56695
|
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
|
|
56661
|
-
return
|
|
56696
|
+
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
56662
56697
|
}
|
|
56663
56698
|
return 16777215;
|
|
56664
56699
|
}
|
|
56700
|
+
function getIntersectionTypeFacts(type, ignoreObjects) {
|
|
56701
|
+
var oredFacts = 0;
|
|
56702
|
+
var andedFacts = 16777215;
|
|
56703
|
+
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
56704
|
+
var t = _a[_i];
|
|
56705
|
+
var f = getTypeFacts(t, ignoreObjects);
|
|
56706
|
+
oredFacts |= f;
|
|
56707
|
+
andedFacts &= f;
|
|
56708
|
+
}
|
|
56709
|
+
return oredFacts & 8288 | andedFacts & 16768927;
|
|
56710
|
+
}
|
|
56665
56711
|
function getTypeWithFacts(type, include) {
|
|
56666
56712
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
56667
56713
|
}
|
|
@@ -65251,7 +65297,7 @@ var ts;
|
|
|
65251
65297
|
}
|
|
65252
65298
|
}
|
|
65253
65299
|
function checkExpression(node, checkMode, forceTuple) {
|
|
65254
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
|
|
65300
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
65255
65301
|
var saveCurrentNode = currentNode;
|
|
65256
65302
|
currentNode = node;
|
|
65257
65303
|
instantiationCount = 0;
|
|
@@ -67508,7 +67554,7 @@ var ts;
|
|
|
67508
67554
|
return;
|
|
67509
67555
|
}
|
|
67510
67556
|
var symbol = getSymbolOfNode(node);
|
|
67511
|
-
if (symbol.flags & 2097152 && ts.
|
|
67557
|
+
if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
67512
67558
|
checkAliasSymbol(node);
|
|
67513
67559
|
return;
|
|
67514
67560
|
}
|
|
@@ -67580,7 +67626,7 @@ var ts;
|
|
|
67580
67626
|
return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
67581
67627
|
}
|
|
67582
67628
|
function checkVariableDeclaration(node) {
|
|
67583
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
|
|
67629
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
67584
67630
|
checkGrammarVariableDeclaration(node);
|
|
67585
67631
|
checkVariableLikeDeclaration(node);
|
|
67586
67632
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -69569,6 +69615,17 @@ var ts;
|
|
|
69569
69615
|
return false;
|
|
69570
69616
|
}
|
|
69571
69617
|
}
|
|
69618
|
+
if (!ts.isImportEqualsDeclaration(node) && node.assertClause) {
|
|
69619
|
+
var hasError = false;
|
|
69620
|
+
for (var _i = 0, _a = node.assertClause.elements; _i < _a.length; _i++) {
|
|
69621
|
+
var clause = _a[_i];
|
|
69622
|
+
if (!ts.isStringLiteral(clause.value)) {
|
|
69623
|
+
hasError = true;
|
|
69624
|
+
error(clause.value, ts.Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
|
|
69625
|
+
}
|
|
69626
|
+
}
|
|
69627
|
+
return !hasError;
|
|
69628
|
+
}
|
|
69572
69629
|
return true;
|
|
69573
69630
|
}
|
|
69574
69631
|
function checkAliasSymbol(node) {
|
|
@@ -70204,7 +70261,7 @@ var ts;
|
|
|
70204
70261
|
}
|
|
70205
70262
|
}
|
|
70206
70263
|
function checkDeferredNode(node) {
|
|
70207
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
|
|
70264
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
70208
70265
|
var saveCurrentNode = currentNode;
|
|
70209
70266
|
currentNode = node;
|
|
70210
70267
|
instantiationCount = 0;
|
|
@@ -73784,7 +73841,7 @@ var ts;
|
|
|
73784
73841
|
return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
|
|
73785
73842
|
case 293:
|
|
73786
73843
|
ts.Debug.type(node);
|
|
73787
|
-
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.
|
|
73844
|
+
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isExpressionNode));
|
|
73788
73845
|
case 266:
|
|
73789
73846
|
ts.Debug.type(node);
|
|
73790
73847
|
return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
|
|
@@ -79784,10 +79841,16 @@ var ts;
|
|
|
79784
79841
|
var _a;
|
|
79785
79842
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79786
79843
|
var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
|
|
79787
|
-
var args = [tagName, objectProperties
|
|
79844
|
+
var args = [tagName, objectProperties];
|
|
79845
|
+
if (keyAttr) {
|
|
79846
|
+
args.push(transformJsxAttributeInitializer(keyAttr.initializer));
|
|
79847
|
+
}
|
|
79788
79848
|
if (compilerOptions.jsx === 5) {
|
|
79789
79849
|
var originalFile = ts.getOriginalNode(currentSourceFile);
|
|
79790
79850
|
if (originalFile && ts.isSourceFile(originalFile)) {
|
|
79851
|
+
if (keyAttr === undefined) {
|
|
79852
|
+
args.push(factory.createVoidZero());
|
|
79853
|
+
}
|
|
79791
79854
|
args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
|
|
79792
79855
|
var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
|
|
79793
79856
|
args.push(factory.createObjectLiteralExpression([
|
|
@@ -98634,11 +98697,12 @@ var ts;
|
|
|
98634
98697
|
};
|
|
98635
98698
|
}
|
|
98636
98699
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
98700
|
+
var _a;
|
|
98637
98701
|
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
|
|
98638
98702
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
98639
98703
|
return false;
|
|
98640
98704
|
}
|
|
98641
|
-
return ts.getImpliedNodeFormatForFile(importingSourceFileName,
|
|
98705
|
+
return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
|
|
98642
98706
|
}
|
|
98643
98707
|
function getModuleResolutionHost(host) {
|
|
98644
98708
|
var _a;
|
|
@@ -99111,11 +99175,13 @@ var ts;
|
|
|
99111
99175
|
var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
|
|
99112
99176
|
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
|
|
99113
99177
|
function tryDirectoryWithPackageJson(packageRootIndex) {
|
|
99178
|
+
var _a, _b;
|
|
99114
99179
|
var packageRootPath = path.substring(0, packageRootIndex);
|
|
99115
99180
|
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
|
|
99116
99181
|
var moduleFileToTry = path;
|
|
99117
|
-
|
|
99118
|
-
|
|
99182
|
+
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
99183
|
+
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
99184
|
+
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
99119
99185
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
99120
99186
|
var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
99121
99187
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
@@ -99382,22 +99448,31 @@ var ts;
|
|
|
99382
99448
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99383
99449
|
}
|
|
99384
99450
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99451
|
+
function prettyPathForFileError(error, cwd) {
|
|
99452
|
+
var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
|
|
99453
|
+
if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
|
|
99454
|
+
return ts.getRelativePathFromDirectory(cwd, error.fileName, false) + line;
|
|
99455
|
+
}
|
|
99456
|
+
return error.fileName + line;
|
|
99457
|
+
}
|
|
99385
99458
|
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
99386
99459
|
if (errorCount === 0)
|
|
99387
99460
|
return "";
|
|
99388
99461
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99389
99462
|
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99390
99463
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99464
|
+
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
99391
99465
|
var d = errorCount === 1 ?
|
|
99392
99466
|
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
99393
99467
|
ts.Diagnostics.Found_1_error_in_1 :
|
|
99394
|
-
ts.Diagnostics.Found_1_error, errorCount,
|
|
99468
|
+
ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
|
|
99395
99469
|
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
99396
99470
|
ts.Diagnostics.Found_0_errors :
|
|
99397
99471
|
distinctFileNamesWithLines.length === 1 ?
|
|
99398
|
-
ts.Diagnostics.
|
|
99399
|
-
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99400
|
-
|
|
99472
|
+
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
99473
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
99474
|
+
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
99475
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
99401
99476
|
}
|
|
99402
99477
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99403
99478
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -99419,8 +99494,8 @@ var ts;
|
|
|
99419
99494
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99420
99495
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99421
99496
|
: "";
|
|
99422
|
-
var
|
|
99423
|
-
tabularData += "" + leftPadding + errorCount + " " +
|
|
99497
|
+
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
99498
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
99424
99499
|
});
|
|
99425
99500
|
return tabularData;
|
|
99426
99501
|
}
|
|
@@ -99885,6 +99960,7 @@ var ts;
|
|
|
99885
99960
|
var sharedExtendedConfigFileWatchers;
|
|
99886
99961
|
var extendedConfigCache = host.extendedConfigCache;
|
|
99887
99962
|
var changesAffectResolution = false;
|
|
99963
|
+
var reportFileChangeDetectedOnCreateProgram = false;
|
|
99888
99964
|
var sourceFilesCache = new ts.Map();
|
|
99889
99965
|
var missingFilePathsRequestedForRelease;
|
|
99890
99966
|
var hasChangedCompilerOptions = false;
|
|
@@ -100038,14 +100114,21 @@ var ts;
|
|
|
100038
100114
|
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
|
|
100039
100115
|
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
100040
100116
|
if (hasChangedConfigFileParsingErrors) {
|
|
100117
|
+
if (reportFileChangeDetectedOnCreateProgram) {
|
|
100118
|
+
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
100119
|
+
}
|
|
100041
100120
|
builderProgram = createProgram(undefined, undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
100042
100121
|
hasChangedConfigFileParsingErrors = false;
|
|
100043
100122
|
}
|
|
100044
100123
|
}
|
|
100045
100124
|
else {
|
|
100125
|
+
if (reportFileChangeDetectedOnCreateProgram) {
|
|
100126
|
+
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
100127
|
+
}
|
|
100046
100128
|
createNewProgram(hasInvalidatedResolution);
|
|
100047
100129
|
}
|
|
100048
100130
|
changesAffectResolution = false;
|
|
100131
|
+
reportFileChangeDetectedOnCreateProgram = false;
|
|
100049
100132
|
if (host.afterProgramCreate && program !== builderProgram) {
|
|
100050
100133
|
host.afterProgramCreate(builderProgram);
|
|
100051
100134
|
}
|
|
@@ -100224,7 +100307,7 @@ var ts;
|
|
|
100224
100307
|
}
|
|
100225
100308
|
function updateProgramWithWatchStatus() {
|
|
100226
100309
|
timerToUpdateProgram = undefined;
|
|
100227
|
-
|
|
100310
|
+
reportFileChangeDetectedOnCreateProgram = true;
|
|
100228
100311
|
updateProgram();
|
|
100229
100312
|
}
|
|
100230
100313
|
function updateProgram() {
|