typescript 4.5.0-dev.20211026 → 4.5.0-dev.20211030
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/cs/diagnosticMessages.generated.json +1 -0
- package/lib/de/diagnosticMessages.generated.json +1 -0
- package/lib/es/diagnosticMessages.generated.json +1 -0
- package/lib/fr/diagnosticMessages.generated.json +1 -0
- package/lib/it/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/lib.dom.d.ts +186 -92
- package/lib/lib.dom.iterable.d.ts +1 -7
- package/lib/lib.webworker.d.ts +60 -19
- package/lib/lib.webworker.iterable.d.ts +0 -7
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/protocol.d.ts +7 -0
- package/lib/pt-br/diagnosticMessages.generated.json +1 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +319 -127
- package/lib/tsserver.js +652 -196
- package/lib/tsserverlibrary.d.ts +8 -0
- package/lib/tsserverlibrary.js +652 -196
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +648 -196
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +648 -196
- package/lib/typingsInstaller.js +380 -133
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -0
- package/package.json +1 -1
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.5";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211030";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -2129,6 +2129,10 @@ var ts;
|
|
|
2129
2129
|
return formatEnum(kind, ts.SyntaxKind, false);
|
|
2130
2130
|
}
|
|
2131
2131
|
Debug.formatSyntaxKind = formatSyntaxKind;
|
|
2132
|
+
function formatSnippetKind(kind) {
|
|
2133
|
+
return formatEnum(kind, ts.SnippetKind, false);
|
|
2134
|
+
}
|
|
2135
|
+
Debug.formatSnippetKind = formatSnippetKind;
|
|
2132
2136
|
function formatNodeFlags(flags) {
|
|
2133
2137
|
return formatEnum(flags, ts.NodeFlags, true);
|
|
2134
2138
|
}
|
|
@@ -5906,6 +5910,8 @@ var ts;
|
|
|
5906
5910
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
|
|
5907
5911
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
5908
5912
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
5913
|
+
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."),
|
|
5914
|
+
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}'?"),
|
|
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}'."),
|
|
@@ -6012,6 +6018,7 @@ var ts;
|
|
|
6012
6018
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
|
|
6013
6019
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
6014
6020
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
6021
|
+
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, ts.DiagnosticCategory.Error, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6015
6022
|
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6016
6023
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6017
6024
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -6565,6 +6572,7 @@ var ts;
|
|
|
6565
6572
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
|
|
6566
6573
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
|
|
6567
6574
|
A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
|
|
6575
|
+
JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
|
|
6568
6576
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
6569
6577
|
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
|
|
6570
6578
|
import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
|
|
@@ -6668,6 +6676,7 @@ var ts;
|
|
|
6668
6676
|
Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
|
|
6669
6677
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
6670
6678
|
Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
|
|
6679
|
+
Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
|
|
6671
6680
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
6672
6681
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
6673
6682
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -15532,6 +15541,8 @@ var ts;
|
|
|
15532
15541
|
case ts.ModuleKind.ES2020:
|
|
15533
15542
|
case ts.ModuleKind.ES2022:
|
|
15534
15543
|
case ts.ModuleKind.ESNext:
|
|
15544
|
+
case ts.ModuleKind.Node12:
|
|
15545
|
+
case ts.ModuleKind.NodeNext:
|
|
15535
15546
|
return true;
|
|
15536
15547
|
default:
|
|
15537
15548
|
return false;
|
|
@@ -16508,6 +16519,10 @@ var ts;
|
|
|
16508
16519
|
return node.kind === 212 || node.kind === 213;
|
|
16509
16520
|
}
|
|
16510
16521
|
ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
|
|
16522
|
+
function escapeSnippetText(text) {
|
|
16523
|
+
return text.replace(/\$/gm, "\\$");
|
|
16524
|
+
}
|
|
16525
|
+
ts.escapeSnippetText = escapeSnippetText;
|
|
16511
16526
|
})(ts || (ts = {}));
|
|
16512
16527
|
var ts;
|
|
16513
16528
|
(function (ts) {
|
|
@@ -21699,6 +21714,17 @@ var ts;
|
|
|
21699
21714
|
}
|
|
21700
21715
|
}
|
|
21701
21716
|
ts.moveEmitHelpers = moveEmitHelpers;
|
|
21717
|
+
function getSnippetElement(node) {
|
|
21718
|
+
var _a;
|
|
21719
|
+
return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.snippetElement;
|
|
21720
|
+
}
|
|
21721
|
+
ts.getSnippetElement = getSnippetElement;
|
|
21722
|
+
function setSnippetElement(node, snippet) {
|
|
21723
|
+
var emitNode = getOrCreateEmitNode(node);
|
|
21724
|
+
emitNode.snippetElement = snippet;
|
|
21725
|
+
return node;
|
|
21726
|
+
}
|
|
21727
|
+
ts.setSnippetElement = setSnippetElement;
|
|
21702
21728
|
function ignoreSourceNewlines(node) {
|
|
21703
21729
|
getOrCreateEmitNode(node).flags |= 134217728;
|
|
21704
21730
|
return node;
|
|
@@ -38537,6 +38563,7 @@ var ts;
|
|
|
38537
38563
|
isDeclarationVisible: isDeclarationVisible,
|
|
38538
38564
|
isPropertyAccessible: isPropertyAccessible,
|
|
38539
38565
|
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
38566
|
+
getMemberOverrideModifierStatus: getMemberOverrideModifierStatus,
|
|
38540
38567
|
};
|
|
38541
38568
|
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
|
|
38542
38569
|
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
|
|
@@ -38769,6 +38796,17 @@ var ts;
|
|
|
38769
38796
|
var enumRelation = new ts.Map();
|
|
38770
38797
|
var builtinGlobals = ts.createSymbolTable();
|
|
38771
38798
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
38799
|
+
var suggestedExtensions = [
|
|
38800
|
+
[".mts", ".mjs"],
|
|
38801
|
+
[".ts", ".js"],
|
|
38802
|
+
[".cts", ".cjs"],
|
|
38803
|
+
[".mjs", ".mjs"],
|
|
38804
|
+
[".js", ".js"],
|
|
38805
|
+
[".cjs", ".cjs"],
|
|
38806
|
+
[".tsx", compilerOptions.jsx === 1 ? ".jsx" : ".js"],
|
|
38807
|
+
[".jsx", ".jsx"],
|
|
38808
|
+
[".json", ".json"],
|
|
38809
|
+
];
|
|
38772
38810
|
initializeTypeChecker();
|
|
38773
38811
|
return checker;
|
|
38774
38812
|
function getJsxNamespace(location) {
|
|
@@ -40055,6 +40093,10 @@ var ts;
|
|
|
40055
40093
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
40056
40094
|
return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
|
|
40057
40095
|
}
|
|
40096
|
+
function isOnlyImportedAsDefault(usage) {
|
|
40097
|
+
var usageMode = getUsageModeForExpression(usage);
|
|
40098
|
+
return usageMode === ts.ModuleKind.ESNext && ts.endsWith(usage.text, ".json");
|
|
40099
|
+
}
|
|
40058
40100
|
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
40059
40101
|
var usageMode = file && getUsageModeForExpression(usage);
|
|
40060
40102
|
if (file && usageMode !== undefined) {
|
|
@@ -40093,8 +40135,9 @@ var ts;
|
|
|
40093
40135
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias);
|
|
40094
40136
|
}
|
|
40095
40137
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
40138
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
|
|
40096
40139
|
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
|
|
40097
|
-
if (!exportDefaultSymbol && !hasSyntheticDefault) {
|
|
40140
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
40098
40141
|
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
40099
40142
|
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
40100
40143
|
var exportEqualsSymbol = moduleSymbol.exports.get("export=");
|
|
@@ -40108,7 +40151,7 @@ var ts;
|
|
|
40108
40151
|
reportNonDefaultExport(moduleSymbol, node);
|
|
40109
40152
|
}
|
|
40110
40153
|
}
|
|
40111
|
-
else if (hasSyntheticDefault) {
|
|
40154
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
40112
40155
|
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
40113
40156
|
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, false);
|
|
40114
40157
|
return resolved;
|
|
@@ -40212,7 +40255,7 @@ var ts;
|
|
|
40212
40255
|
var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
40213
40256
|
if (symbolFromModule === undefined && name.escapedText === "default") {
|
|
40214
40257
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
40215
|
-
if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
40258
|
+
if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
40216
40259
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
40217
40260
|
}
|
|
40218
40261
|
}
|
|
@@ -40666,7 +40709,7 @@ var ts;
|
|
|
40666
40709
|
: undefined;
|
|
40667
40710
|
}
|
|
40668
40711
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
|
|
40669
|
-
var _a, _b, _c, _d, _e, _f;
|
|
40712
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
40670
40713
|
if (isForAugmentation === void 0) { isForAugmentation = false; }
|
|
40671
40714
|
if (ts.startsWith(moduleReference, "@types/")) {
|
|
40672
40715
|
var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
@@ -40700,6 +40743,9 @@ var ts;
|
|
|
40700
40743
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
40701
40744
|
error(errorNode, ts.Diagnostics.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, moduleReference);
|
|
40702
40745
|
}
|
|
40746
|
+
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json") {
|
|
40747
|
+
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
40748
|
+
}
|
|
40703
40749
|
}
|
|
40704
40750
|
return getMergedSymbol(sourceFile.symbol);
|
|
40705
40751
|
}
|
|
@@ -40741,6 +40787,10 @@ var ts;
|
|
|
40741
40787
|
}
|
|
40742
40788
|
else {
|
|
40743
40789
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
40790
|
+
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
40791
|
+
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
40792
|
+
var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
|
|
40793
|
+
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
40744
40794
|
if (tsExtension) {
|
|
40745
40795
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
40746
40796
|
var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
|
|
@@ -40756,6 +40806,19 @@ var ts;
|
|
|
40756
40806
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
40757
40807
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
40758
40808
|
}
|
|
40809
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
|
|
40810
|
+
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
40811
|
+
var suggestedExt = (_g = suggestedExtensions.find(function (_a) {
|
|
40812
|
+
var actualExt = _a[0], _importExt = _a[1];
|
|
40813
|
+
return host.fileExists(absoluteRef_1 + actualExt);
|
|
40814
|
+
})) === null || _g === void 0 ? void 0 : _g[1];
|
|
40815
|
+
if (suggestedExt) {
|
|
40816
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
40817
|
+
}
|
|
40818
|
+
else {
|
|
40819
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
40820
|
+
}
|
|
40821
|
+
}
|
|
40759
40822
|
else {
|
|
40760
40823
|
error(errorNode, moduleNotFoundError, moduleReference);
|
|
40761
40824
|
}
|
|
@@ -40819,39 +40882,47 @@ var ts;
|
|
|
40819
40882
|
error(referencingLocation, ts.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName);
|
|
40820
40883
|
return symbol;
|
|
40821
40884
|
}
|
|
40822
|
-
|
|
40823
|
-
|
|
40824
|
-
|
|
40825
|
-
|
|
40826
|
-
|
|
40885
|
+
var referenceParent = referencingLocation.parent;
|
|
40886
|
+
if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
|
|
40887
|
+
ts.isImportCall(referenceParent)) {
|
|
40888
|
+
var reference = ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier;
|
|
40889
|
+
var type = getTypeOfSymbol(symbol);
|
|
40890
|
+
var defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference);
|
|
40891
|
+
if (defaultOnlyType) {
|
|
40892
|
+
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
40893
|
+
}
|
|
40894
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
40827
40895
|
var sigs = getSignaturesOfStructuredType(type, 0);
|
|
40828
40896
|
if (!sigs || !sigs.length) {
|
|
40829
40897
|
sigs = getSignaturesOfStructuredType(type, 1);
|
|
40830
40898
|
}
|
|
40831
|
-
if (sigs && sigs.length) {
|
|
40832
|
-
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol,
|
|
40833
|
-
|
|
40834
|
-
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
40835
|
-
result.parent = symbol.parent;
|
|
40836
|
-
result.target = symbol;
|
|
40837
|
-
result.originatingImport = referenceParent;
|
|
40838
|
-
if (symbol.valueDeclaration)
|
|
40839
|
-
result.valueDeclaration = symbol.valueDeclaration;
|
|
40840
|
-
if (symbol.constEnumOnlyModule)
|
|
40841
|
-
result.constEnumOnlyModule = true;
|
|
40842
|
-
if (symbol.members)
|
|
40843
|
-
result.members = new ts.Map(symbol.members);
|
|
40844
|
-
if (symbol.exports)
|
|
40845
|
-
result.exports = new ts.Map(symbol.exports);
|
|
40846
|
-
var resolvedModuleType = resolveStructuredTypeMembers(moduleType);
|
|
40847
|
-
result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
|
|
40848
|
-
return result;
|
|
40899
|
+
if ((sigs && sigs.length) || getPropertyOfType(type, "default")) {
|
|
40900
|
+
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
40901
|
+
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
40849
40902
|
}
|
|
40850
40903
|
}
|
|
40851
40904
|
}
|
|
40852
40905
|
}
|
|
40853
40906
|
return symbol;
|
|
40854
40907
|
}
|
|
40908
|
+
function cloneTypeAsModuleType(symbol, moduleType, referenceParent) {
|
|
40909
|
+
var result = createSymbol(symbol.flags, symbol.escapedName);
|
|
40910
|
+
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
40911
|
+
result.parent = symbol.parent;
|
|
40912
|
+
result.target = symbol;
|
|
40913
|
+
result.originatingImport = referenceParent;
|
|
40914
|
+
if (symbol.valueDeclaration)
|
|
40915
|
+
result.valueDeclaration = symbol.valueDeclaration;
|
|
40916
|
+
if (symbol.constEnumOnlyModule)
|
|
40917
|
+
result.constEnumOnlyModule = true;
|
|
40918
|
+
if (symbol.members)
|
|
40919
|
+
result.members = new ts.Map(symbol.members);
|
|
40920
|
+
if (symbol.exports)
|
|
40921
|
+
result.exports = new ts.Map(symbol.exports);
|
|
40922
|
+
var resolvedModuleType = resolveStructuredTypeMembers(moduleType);
|
|
40923
|
+
result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
|
|
40924
|
+
return result;
|
|
40925
|
+
}
|
|
40855
40926
|
function hasExportAssignmentSymbol(moduleSymbol) {
|
|
40856
40927
|
return moduleSymbol.exports.get("export=") !== undefined;
|
|
40857
40928
|
}
|
|
@@ -49233,7 +49304,7 @@ var ts;
|
|
|
49233
49304
|
var _loop_16 = function () {
|
|
49234
49305
|
i--;
|
|
49235
49306
|
var t = types[i];
|
|
49236
|
-
if (t.flags & 128 && ts.some(templates, function (template) { return
|
|
49307
|
+
if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
49237
49308
|
ts.orderedRemoveItemAt(types, i);
|
|
49238
49309
|
}
|
|
49239
49310
|
};
|
|
@@ -51185,7 +51256,9 @@ var ts;
|
|
|
51185
51256
|
return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
|
|
51186
51257
|
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && !isErrorType(t)) {
|
|
51187
51258
|
if (!type.declaration.nameType) {
|
|
51188
|
-
|
|
51259
|
+
var constraint = void 0;
|
|
51260
|
+
if (isArrayType(t) || t.flags & 1 && findResolutionCycleStartIndex(typeVariable, 4) < 0 &&
|
|
51261
|
+
(constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
|
|
51189
51262
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
51190
51263
|
}
|
|
51191
51264
|
if (isGenericTupleType(t)) {
|
|
@@ -52558,10 +52631,11 @@ var ts;
|
|
|
52558
52631
|
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
52559
52632
|
var result = 0;
|
|
52560
52633
|
var saveErrorInfo = captureErrorCalculationState();
|
|
52561
|
-
if (source.flags &
|
|
52562
|
-
result =
|
|
52563
|
-
|
|
52564
|
-
|
|
52634
|
+
if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
52635
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
|
|
52636
|
+
}
|
|
52637
|
+
else if (source.flags & 3145728 || target.flags & 3145728) {
|
|
52638
|
+
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
|
|
52565
52639
|
}
|
|
52566
52640
|
if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
|
|
52567
52641
|
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
@@ -52941,19 +53015,19 @@ var ts;
|
|
|
52941
53015
|
var maybeStart = maybeCount;
|
|
52942
53016
|
maybeKeys[maybeCount] = id;
|
|
52943
53017
|
maybeCount++;
|
|
53018
|
+
var saveExpandingFlags = expandingFlags;
|
|
52944
53019
|
if (recursionFlags & 1) {
|
|
52945
53020
|
sourceStack[sourceDepth] = source;
|
|
52946
53021
|
sourceDepth++;
|
|
53022
|
+
if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
53023
|
+
expandingFlags |= 1;
|
|
52947
53024
|
}
|
|
52948
53025
|
if (recursionFlags & 2) {
|
|
52949
53026
|
targetStack[targetDepth] = target;
|
|
52950
53027
|
targetDepth++;
|
|
53028
|
+
if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
53029
|
+
expandingFlags |= 2;
|
|
52951
53030
|
}
|
|
52952
|
-
var saveExpandingFlags = expandingFlags;
|
|
52953
|
-
if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
52954
|
-
expandingFlags |= 1;
|
|
52955
|
-
if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
52956
|
-
expandingFlags |= 2;
|
|
52957
53031
|
var originalHandler;
|
|
52958
53032
|
var propagatingVarianceFlags = 0;
|
|
52959
53033
|
if (outofbandVarianceMarkerHandler) {
|
|
@@ -52977,13 +53051,13 @@ var ts;
|
|
|
52977
53051
|
if (outofbandVarianceMarkerHandler) {
|
|
52978
53052
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
52979
53053
|
}
|
|
52980
|
-
expandingFlags = saveExpandingFlags;
|
|
52981
53054
|
if (recursionFlags & 1) {
|
|
52982
53055
|
sourceDepth--;
|
|
52983
53056
|
}
|
|
52984
53057
|
if (recursionFlags & 2) {
|
|
52985
53058
|
targetDepth--;
|
|
52986
53059
|
}
|
|
53060
|
+
expandingFlags = saveExpandingFlags;
|
|
52987
53061
|
if (result) {
|
|
52988
53062
|
if (result === -1 || (sourceDepth === 0 && targetDepth === 0)) {
|
|
52989
53063
|
if (result === -1 || result === 3) {
|
|
@@ -53238,8 +53312,7 @@ var ts;
|
|
|
53238
53312
|
}
|
|
53239
53313
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
53240
53314
|
}
|
|
53241
|
-
|
|
53242
|
-
if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
|
|
53315
|
+
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
53243
53316
|
return -1;
|
|
53244
53317
|
}
|
|
53245
53318
|
}
|
|
@@ -53399,9 +53472,9 @@ var ts;
|
|
|
53399
53472
|
if (source.flags & (524288 | 2097152) && target.flags & 1048576) {
|
|
53400
53473
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
|
|
53401
53474
|
if (objectOnlyTarget.flags & 1048576) {
|
|
53402
|
-
var
|
|
53403
|
-
if (
|
|
53404
|
-
return
|
|
53475
|
+
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
53476
|
+
if (result_9) {
|
|
53477
|
+
return result_9;
|
|
53405
53478
|
}
|
|
53406
53479
|
}
|
|
53407
53480
|
}
|
|
@@ -53448,13 +53521,13 @@ var ts;
|
|
|
53448
53521
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
53449
53522
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
53450
53523
|
if (modifiersRelated) {
|
|
53451
|
-
var
|
|
53524
|
+
var result_10;
|
|
53452
53525
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
53453
53526
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
53454
|
-
if (
|
|
53527
|
+
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
|
|
53455
53528
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
53456
53529
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
53457
|
-
return
|
|
53530
|
+
return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3, reportErrors);
|
|
53458
53531
|
}
|
|
53459
53532
|
}
|
|
53460
53533
|
}
|
|
@@ -55288,6 +55361,10 @@ var ts;
|
|
|
55288
55361
|
inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
|
|
55289
55362
|
undefined;
|
|
55290
55363
|
}
|
|
55364
|
+
function isTypeMatchedByTemplateLiteralType(source, target) {
|
|
55365
|
+
var inferences = inferTypesFromTemplateLiteralType(source, target);
|
|
55366
|
+
return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
|
|
55367
|
+
}
|
|
55291
55368
|
function getStringLikeTypeForType(type) {
|
|
55292
55369
|
return type.flags & (1 | 402653316) ? type : getTemplateLiteralType(["", ""], [type]);
|
|
55293
55370
|
}
|
|
@@ -56041,8 +56118,10 @@ var ts;
|
|
|
56041
56118
|
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
|
|
56042
56119
|
switch (node.kind) {
|
|
56043
56120
|
case 79:
|
|
56044
|
-
|
|
56045
|
-
|
|
56121
|
+
if (!ts.isThisInTypeQuery(node)) {
|
|
56122
|
+
var symbol = getResolvedSymbol(node);
|
|
56123
|
+
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
|
|
56124
|
+
}
|
|
56046
56125
|
case 108:
|
|
56047
56126
|
return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
|
|
56048
56127
|
case 229:
|
|
@@ -56641,7 +56720,7 @@ var ts;
|
|
|
56641
56720
|
mapType(type, mapper);
|
|
56642
56721
|
}
|
|
56643
56722
|
function getConstituentCount(type) {
|
|
56644
|
-
return type.flags &
|
|
56723
|
+
return type.flags & 1048576 ? type.types.length : 1;
|
|
56645
56724
|
}
|
|
56646
56725
|
function extractTypesOfKind(type, kind) {
|
|
56647
56726
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
@@ -57927,7 +58006,7 @@ var ts;
|
|
|
57927
58006
|
return parent.kind === 205 ||
|
|
57928
58007
|
parent.kind === 207 && parent.expression === node ||
|
|
57929
58008
|
parent.kind === 206 && parent.expression === node &&
|
|
57930
|
-
!(
|
|
58009
|
+
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
57931
58010
|
}
|
|
57932
58011
|
function isGenericTypeWithUnionConstraint(type) {
|
|
57933
58012
|
return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
|
|
@@ -62628,11 +62707,33 @@ var ts;
|
|
|
62628
62707
|
if (moduleSymbol) {
|
|
62629
62708
|
var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true, false);
|
|
62630
62709
|
if (esModuleSymbol) {
|
|
62631
|
-
return createPromiseReturnType(node,
|
|
62710
|
+
return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) ||
|
|
62711
|
+
getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
|
|
62632
62712
|
}
|
|
62633
62713
|
}
|
|
62634
62714
|
return createPromiseReturnType(node, anyType);
|
|
62635
62715
|
}
|
|
62716
|
+
function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) {
|
|
62717
|
+
var memberTable = ts.createSymbolTable();
|
|
62718
|
+
var newSymbol = createSymbol(2097152, "default");
|
|
62719
|
+
newSymbol.parent = originalSymbol;
|
|
62720
|
+
newSymbol.nameType = getStringLiteralType("default");
|
|
62721
|
+
newSymbol.target = resolveSymbol(symbol);
|
|
62722
|
+
memberTable.set("default", newSymbol);
|
|
62723
|
+
return createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
62724
|
+
}
|
|
62725
|
+
function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) {
|
|
62726
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier);
|
|
62727
|
+
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
62728
|
+
var synthType = type;
|
|
62729
|
+
if (!synthType.defaultOnlyType) {
|
|
62730
|
+
var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
62731
|
+
synthType.defaultOnlyType = type_4;
|
|
62732
|
+
}
|
|
62733
|
+
return synthType.defaultOnlyType;
|
|
62734
|
+
}
|
|
62735
|
+
return undefined;
|
|
62736
|
+
}
|
|
62636
62737
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
62637
62738
|
var _a;
|
|
62638
62739
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
@@ -62641,14 +62742,8 @@ var ts;
|
|
|
62641
62742
|
var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
62642
62743
|
var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false, moduleSpecifier);
|
|
62643
62744
|
if (hasSyntheticDefault) {
|
|
62644
|
-
var memberTable = ts.createSymbolTable();
|
|
62645
|
-
var newSymbol = createSymbol(2097152, "default");
|
|
62646
|
-
newSymbol.parent = originalSymbol;
|
|
62647
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
62648
|
-
newSymbol.target = resolveSymbol(symbol);
|
|
62649
|
-
memberTable.set("default", newSymbol);
|
|
62650
62745
|
var anonymousSymbol = createSymbol(2048, "__type");
|
|
62651
|
-
var defaultContainingObject =
|
|
62746
|
+
var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
62652
62747
|
anonymousSymbol.type = defaultContainingObject;
|
|
62653
62748
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
62654
62749
|
}
|
|
@@ -63295,11 +63390,11 @@ var ts;
|
|
|
63295
63390
|
var operandType = getTypeOfExpression(node.expression.expression);
|
|
63296
63391
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, false);
|
|
63297
63392
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true);
|
|
63298
|
-
var
|
|
63299
|
-
if (
|
|
63393
|
+
var type_5 = getBaseConstraintOfType(operandType) || operandType;
|
|
63394
|
+
if (type_5.flags & 3) {
|
|
63300
63395
|
return (556800 & notEqualFacts_1) === 556800;
|
|
63301
63396
|
}
|
|
63302
|
-
return !!(filterType(
|
|
63397
|
+
return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
|
|
63303
63398
|
}
|
|
63304
63399
|
var type = getTypeOfExpression(node.expression);
|
|
63305
63400
|
if (!isLiteralType(type)) {
|
|
@@ -66056,12 +66151,12 @@ var ts;
|
|
|
66056
66151
|
case 264:
|
|
66057
66152
|
case 267:
|
|
66058
66153
|
case 266:
|
|
66059
|
-
var
|
|
66154
|
+
var result_11 = 0;
|
|
66060
66155
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
66061
66156
|
ts.forEach(target.declarations, function (d) {
|
|
66062
|
-
|
|
66157
|
+
result_11 |= getDeclarationSpaces(d);
|
|
66063
66158
|
});
|
|
66064
|
-
return
|
|
66159
|
+
return result_11;
|
|
66065
66160
|
case 253:
|
|
66066
66161
|
case 202:
|
|
66067
66162
|
case 255:
|
|
@@ -68332,7 +68427,7 @@ var ts;
|
|
|
68332
68427
|
checkKindsOfPropertyMemberOverrides(type, baseType_1);
|
|
68333
68428
|
}
|
|
68334
68429
|
}
|
|
68335
|
-
|
|
68430
|
+
checkMembersForOverrideModifier(node, type, typeWithThis, staticType);
|
|
68336
68431
|
var implementedTypeNodes = ts.getEffectiveImplementsTypeNodes(node);
|
|
68337
68432
|
if (implementedTypeNodes) {
|
|
68338
68433
|
for (var _b = 0, implementedTypeNodes_1 = implementedTypeNodes; _b < implementedTypeNodes_1.length; _b++) {
|
|
@@ -68367,8 +68462,7 @@ var ts;
|
|
|
68367
68462
|
checkPropertyInitialization(node);
|
|
68368
68463
|
}
|
|
68369
68464
|
}
|
|
68370
|
-
function
|
|
68371
|
-
var nodeInAmbientContext = !!(node.flags & 8388608);
|
|
68465
|
+
function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) {
|
|
68372
68466
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
|
|
68373
68467
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
68374
68468
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
@@ -68380,46 +68474,57 @@ var ts;
|
|
|
68380
68474
|
if (ts.isConstructorDeclaration(member)) {
|
|
68381
68475
|
ts.forEach(member.parameters, function (param) {
|
|
68382
68476
|
if (ts.isParameterPropertyDeclaration(param, member)) {
|
|
68383
|
-
|
|
68477
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, param, true);
|
|
68384
68478
|
}
|
|
68385
68479
|
});
|
|
68386
68480
|
}
|
|
68387
|
-
|
|
68481
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, false);
|
|
68388
68482
|
};
|
|
68389
68483
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
68390
68484
|
var member = _a[_i];
|
|
68391
68485
|
_loop_29(member);
|
|
68392
68486
|
}
|
|
68393
|
-
|
|
68394
|
-
|
|
68395
|
-
|
|
68396
|
-
|
|
68397
|
-
|
|
68398
|
-
|
|
68399
|
-
|
|
68400
|
-
|
|
68401
|
-
|
|
68402
|
-
|
|
68403
|
-
|
|
68404
|
-
|
|
68405
|
-
|
|
68406
|
-
|
|
68407
|
-
|
|
68408
|
-
|
|
68487
|
+
}
|
|
68488
|
+
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
68489
|
+
if (reportErrors === void 0) { reportErrors = true; }
|
|
68490
|
+
var declaredProp = member.name
|
|
68491
|
+
&& getSymbolAtLocation(member.name)
|
|
68492
|
+
|| getSymbolAtLocation(member);
|
|
68493
|
+
if (!declaredProp) {
|
|
68494
|
+
return 0;
|
|
68495
|
+
}
|
|
68496
|
+
return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, ts.hasOverrideModifier(member), ts.hasAbstractModifier(member), ts.isStatic(member), memberIsParameterProperty, ts.symbolName(declaredProp), reportErrors ? member : undefined);
|
|
68497
|
+
}
|
|
68498
|
+
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
68499
|
+
var isJs = ts.isInJSFile(node);
|
|
68500
|
+
var nodeInAmbientContext = !!(node.flags & 8388608);
|
|
68501
|
+
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
68502
|
+
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
68503
|
+
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
68504
|
+
var baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
68505
|
+
var prop = getPropertyOfType(thisType, memberEscapedName);
|
|
68506
|
+
var baseProp = getPropertyOfType(baseType, memberEscapedName);
|
|
68507
|
+
var baseClassName = typeToString(baseWithThis);
|
|
68508
|
+
if (prop && !baseProp && memberHasOverrideModifier) {
|
|
68509
|
+
if (errorNode) {
|
|
68510
|
+
var suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType);
|
|
68409
68511
|
suggestion ?
|
|
68410
|
-
error(
|
|
68512
|
+
error(errorNode, isJs ?
|
|
68411
68513
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 :
|
|
68412
68514
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
|
|
68413
|
-
error(
|
|
68515
|
+
error(errorNode, isJs ?
|
|
68414
68516
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
68415
68517
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
68416
68518
|
}
|
|
68417
|
-
|
|
68418
|
-
|
|
68419
|
-
|
|
68420
|
-
|
|
68421
|
-
|
|
68422
|
-
|
|
68519
|
+
return 2;
|
|
68520
|
+
}
|
|
68521
|
+
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
68522
|
+
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
68523
|
+
if (memberHasOverrideModifier) {
|
|
68524
|
+
return 0;
|
|
68525
|
+
}
|
|
68526
|
+
if (!baseHasAbstract) {
|
|
68527
|
+
if (errorNode) {
|
|
68423
68528
|
var diag = memberIsParameterProperty ?
|
|
68424
68529
|
isJs ?
|
|
68425
68530
|
ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
@@ -68427,20 +68532,28 @@ var ts;
|
|
|
68427
68532
|
isJs ?
|
|
68428
68533
|
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
68429
68534
|
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
68430
|
-
error(
|
|
68535
|
+
error(errorNode, diag, baseClassName);
|
|
68431
68536
|
}
|
|
68432
|
-
|
|
68433
|
-
|
|
68537
|
+
return 1;
|
|
68538
|
+
}
|
|
68539
|
+
else if (memberHasAbstractModifier && baseHasAbstract) {
|
|
68540
|
+
if (errorNode) {
|
|
68541
|
+
error(errorNode, ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName);
|
|
68434
68542
|
}
|
|
68543
|
+
return 1;
|
|
68435
68544
|
}
|
|
68436
68545
|
}
|
|
68437
|
-
|
|
68546
|
+
}
|
|
68547
|
+
else if (memberHasOverrideModifier) {
|
|
68548
|
+
if (errorNode) {
|
|
68438
68549
|
var className = typeToString(type);
|
|
68439
|
-
error(
|
|
68550
|
+
error(errorNode, isJs ?
|
|
68440
68551
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
68441
68552
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
68442
68553
|
}
|
|
68554
|
+
return 2;
|
|
68443
68555
|
}
|
|
68556
|
+
return 0;
|
|
68444
68557
|
}
|
|
68445
68558
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
68446
68559
|
var issuedMemberError = false;
|
|
@@ -68480,6 +68593,24 @@ var ts;
|
|
|
68480
68593
|
}
|
|
68481
68594
|
}
|
|
68482
68595
|
}
|
|
68596
|
+
function getMemberOverrideModifierStatus(node, member) {
|
|
68597
|
+
if (!member.name) {
|
|
68598
|
+
return 0;
|
|
68599
|
+
}
|
|
68600
|
+
var symbol = getSymbolOfNode(node);
|
|
68601
|
+
var type = getDeclaredTypeOfSymbol(symbol);
|
|
68602
|
+
var typeWithThis = getTypeWithThisArgument(type);
|
|
68603
|
+
var staticType = getTypeOfSymbol(symbol);
|
|
68604
|
+
var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
|
|
68605
|
+
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
68606
|
+
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
68607
|
+
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
68608
|
+
var memberHasOverrideModifier = member.parent
|
|
68609
|
+
? ts.hasOverrideModifier(member)
|
|
68610
|
+
: ts.hasSyntacticModifier(member, 16384);
|
|
68611
|
+
var memberName = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(member.name));
|
|
68612
|
+
return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, ts.hasAbstractModifier(member), ts.isStatic(member), false, memberName);
|
|
68613
|
+
}
|
|
68483
68614
|
function getTargetSymbol(s) {
|
|
68484
68615
|
return ts.getCheckFlags(s) & 1 ? s.target : s;
|
|
68485
68616
|
}
|
|
@@ -79157,11 +79288,11 @@ var ts;
|
|
|
79157
79288
|
currentFileState.filenameDeclaration = declaration;
|
|
79158
79289
|
return currentFileState.filenameDeclaration.name;
|
|
79159
79290
|
}
|
|
79160
|
-
function getJsxFactoryCalleePrimitive(
|
|
79161
|
-
return compilerOptions.jsx === 5 ? "jsxDEV" :
|
|
79291
|
+
function getJsxFactoryCalleePrimitive(isStaticChildren) {
|
|
79292
|
+
return compilerOptions.jsx === 5 ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
|
|
79162
79293
|
}
|
|
79163
|
-
function getJsxFactoryCallee(
|
|
79164
|
-
var type = getJsxFactoryCalleePrimitive(
|
|
79294
|
+
function getJsxFactoryCallee(isStaticChildren) {
|
|
79295
|
+
var type = getJsxFactoryCalleePrimitive(isStaticChildren);
|
|
79165
79296
|
return getImplicitImportForName(type);
|
|
79166
79297
|
}
|
|
79167
79298
|
function getImplicitJsxFragmentReference() {
|
|
@@ -79300,9 +79431,9 @@ var ts;
|
|
|
79300
79431
|
}
|
|
79301
79432
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
79302
79433
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79303
|
-
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
79304
|
-
var
|
|
79305
|
-
return
|
|
79434
|
+
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
79435
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
79436
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
79306
79437
|
}
|
|
79307
79438
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
79308
79439
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -79314,14 +79445,17 @@ var ts;
|
|
|
79314
79445
|
var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
|
|
79315
79446
|
var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
|
|
79316
79447
|
factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray);
|
|
79317
|
-
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr,
|
|
79448
|
+
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
|
|
79318
79449
|
}
|
|
79319
|
-
function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr,
|
|
79450
|
+
function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) {
|
|
79451
|
+
var _a;
|
|
79452
|
+
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79453
|
+
var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
|
|
79320
79454
|
var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
|
|
79321
79455
|
if (compilerOptions.jsx === 5) {
|
|
79322
79456
|
var originalFile = ts.getOriginalNode(currentSourceFile);
|
|
79323
79457
|
if (originalFile && ts.isSourceFile(originalFile)) {
|
|
79324
|
-
args.push(
|
|
79458
|
+
args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
|
|
79325
79459
|
var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
|
|
79326
79460
|
args.push(factory.createObjectLiteralExpression([
|
|
79327
79461
|
factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()),
|
|
@@ -79331,7 +79465,7 @@ var ts;
|
|
|
79331
79465
|
args.push(factory.createThis());
|
|
79332
79466
|
}
|
|
79333
79467
|
}
|
|
79334
|
-
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(
|
|
79468
|
+
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), undefined, args), location);
|
|
79335
79469
|
if (isChild) {
|
|
79336
79470
|
ts.startOnNewLine(element);
|
|
79337
79471
|
}
|
|
@@ -79359,7 +79493,7 @@ var ts;
|
|
|
79359
79493
|
childrenProps = result;
|
|
79360
79494
|
}
|
|
79361
79495
|
}
|
|
79362
|
-
return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), undefined,
|
|
79496
|
+
return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), undefined, children, isChild, location);
|
|
79363
79497
|
}
|
|
79364
79498
|
function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
|
|
79365
79499
|
var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location);
|
|
@@ -88719,7 +88853,14 @@ var ts;
|
|
|
88719
88853
|
onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node);
|
|
88720
88854
|
currentParenthesizerRule = undefined;
|
|
88721
88855
|
}
|
|
88722
|
-
function pipelineEmitWithHintWorker(hint, node) {
|
|
88856
|
+
function pipelineEmitWithHintWorker(hint, node, allowSnippets) {
|
|
88857
|
+
if (allowSnippets === void 0) { allowSnippets = true; }
|
|
88858
|
+
if (allowSnippets) {
|
|
88859
|
+
var snippet = ts.getSnippetElement(node);
|
|
88860
|
+
if (snippet) {
|
|
88861
|
+
return emitSnippetNode(hint, node, snippet);
|
|
88862
|
+
}
|
|
88863
|
+
}
|
|
88723
88864
|
if (hint === 0)
|
|
88724
88865
|
return emitSourceFile(ts.cast(node, ts.isSourceFile));
|
|
88725
88866
|
if (hint === 2)
|
|
@@ -89268,6 +89409,24 @@ var ts;
|
|
|
89268
89409
|
bundleFileInfo.sections.push(section);
|
|
89269
89410
|
}
|
|
89270
89411
|
}
|
|
89412
|
+
function emitSnippetNode(hint, node, snippet) {
|
|
89413
|
+
switch (snippet.kind) {
|
|
89414
|
+
case 1:
|
|
89415
|
+
emitPlaceholder(hint, node, snippet);
|
|
89416
|
+
break;
|
|
89417
|
+
case 0:
|
|
89418
|
+
emitTabStop(snippet);
|
|
89419
|
+
break;
|
|
89420
|
+
}
|
|
89421
|
+
}
|
|
89422
|
+
function emitPlaceholder(hint, node, snippet) {
|
|
89423
|
+
nonEscapingWrite("${" + snippet.order + ":");
|
|
89424
|
+
pipelineEmitWithHintWorker(hint, node, false);
|
|
89425
|
+
nonEscapingWrite("}");
|
|
89426
|
+
}
|
|
89427
|
+
function emitTabStop(snippet) {
|
|
89428
|
+
nonEscapingWrite("$" + snippet.order);
|
|
89429
|
+
}
|
|
89271
89430
|
function emitIdentifier(node) {
|
|
89272
89431
|
var writeText = node.symbol ? writeSymbol : write;
|
|
89273
89432
|
writeText(getTextOfNode(node, false), node.symbol);
|
|
@@ -91377,6 +91536,14 @@ var ts;
|
|
|
91377
91536
|
function writeProperty(s) {
|
|
91378
91537
|
writer.writeProperty(s);
|
|
91379
91538
|
}
|
|
91539
|
+
function nonEscapingWrite(s) {
|
|
91540
|
+
if (writer.nonEscapingWrite) {
|
|
91541
|
+
writer.nonEscapingWrite(s);
|
|
91542
|
+
}
|
|
91543
|
+
else {
|
|
91544
|
+
writer.write(s);
|
|
91545
|
+
}
|
|
91546
|
+
}
|
|
91380
91547
|
function writeLine(count) {
|
|
91381
91548
|
if (count === void 0) { count = 1; }
|
|
91382
91549
|
for (var i = 0; i < count; i++) {
|
|
@@ -93806,15 +93973,15 @@ var ts;
|
|
|
93806
93973
|
}
|
|
93807
93974
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
93808
93975
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
93809
|
-
var
|
|
93976
|
+
var result_13 = [];
|
|
93810
93977
|
var i = 0;
|
|
93811
93978
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
93812
93979
|
var moduleName = moduleNames_1[_i];
|
|
93813
93980
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
93814
93981
|
i++;
|
|
93815
|
-
|
|
93982
|
+
result_13.push(resolvedModule);
|
|
93816
93983
|
}
|
|
93817
|
-
return
|
|
93984
|
+
return result_13;
|
|
93818
93985
|
}
|
|
93819
93986
|
var unknownModuleNames;
|
|
93820
93987
|
var result;
|
|
@@ -94032,8 +94199,8 @@ var ts;
|
|
|
94032
94199
|
}
|
|
94033
94200
|
var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
|
|
94034
94201
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
94035
|
-
var
|
|
94036
|
-
if (
|
|
94202
|
+
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
94203
|
+
if (typeReferenceResolutionsChanged) {
|
|
94037
94204
|
structureIsReused = 1;
|
|
94038
94205
|
newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
|
|
94039
94206
|
}
|
|
@@ -95172,6 +95339,21 @@ var ts;
|
|
|
95172
95339
|
return resolvedRef;
|
|
95173
95340
|
}
|
|
95174
95341
|
function verifyCompilerOptions() {
|
|
95342
|
+
var isNightly = ts.stringContains(ts.version, "-dev");
|
|
95343
|
+
if (!isNightly) {
|
|
95344
|
+
if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
|
|
95345
|
+
createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "node12");
|
|
95346
|
+
}
|
|
95347
|
+
else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
|
|
95348
|
+
createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "nodenext");
|
|
95349
|
+
}
|
|
95350
|
+
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
|
|
95351
|
+
createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "node12");
|
|
95352
|
+
}
|
|
95353
|
+
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
95354
|
+
createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "nodenext");
|
|
95355
|
+
}
|
|
95356
|
+
}
|
|
95175
95357
|
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
95176
95358
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
95177
95359
|
}
|
|
@@ -95315,7 +95497,9 @@ var ts;
|
|
|
95315
95497
|
}
|
|
95316
95498
|
}
|
|
95317
95499
|
if (options.resolveJsonModule) {
|
|
95318
|
-
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs
|
|
95500
|
+
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
95501
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 &&
|
|
95502
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
95319
95503
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
95320
95504
|
}
|
|
95321
95505
|
else if (!ts.hasJsonModuleEmitEnabled(options)) {
|
|
@@ -95627,8 +95811,8 @@ var ts;
|
|
|
95627
95811
|
function createDiagnosticForOptionName(message, option1, option2, option3) {
|
|
95628
95812
|
createDiagnosticForOption(true, option1, option2, message, option1, option2, option3);
|
|
95629
95813
|
}
|
|
95630
|
-
function createOptionValueDiagnostic(option1, message, arg0) {
|
|
95631
|
-
createDiagnosticForOption(false, option1, undefined, message, arg0);
|
|
95814
|
+
function createOptionValueDiagnostic(option1, message, arg0, arg1) {
|
|
95815
|
+
createDiagnosticForOption(false, option1, undefined, message, arg0, arg1);
|
|
95632
95816
|
}
|
|
95633
95817
|
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
|
|
95634
95818
|
var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
|
|
@@ -97492,6 +97676,9 @@ var ts;
|
|
|
97492
97676
|
else {
|
|
97493
97677
|
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
97494
97678
|
perDirectoryResolution.set(name, mode, resolution);
|
|
97679
|
+
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
97680
|
+
resolutionHost.onDiscoveredSymlink();
|
|
97681
|
+
}
|
|
97495
97682
|
}
|
|
97496
97683
|
resolutionsInFile.set(name, mode, resolution);
|
|
97497
97684
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
@@ -97909,6 +98096,11 @@ var ts;
|
|
|
97909
98096
|
}
|
|
97910
98097
|
}
|
|
97911
98098
|
ts.createResolutionCache = createResolutionCache;
|
|
98099
|
+
function resolutionIsSymlink(resolution) {
|
|
98100
|
+
var _a, _b;
|
|
98101
|
+
return !!(((_a = resolution.resolvedModule) === null || _a === void 0 ? void 0 : _a.originalPath) ||
|
|
98102
|
+
((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath));
|
|
98103
|
+
}
|
|
97912
98104
|
})(ts || (ts = {}));
|
|
97913
98105
|
var ts;
|
|
97914
98106
|
(function (ts) {
|
|
@@ -98144,9 +98336,9 @@ var ts;
|
|
|
98144
98336
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
98145
98337
|
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
98146
98338
|
if (!preferSymlinks) {
|
|
98147
|
-
var
|
|
98148
|
-
if (
|
|
98149
|
-
return
|
|
98339
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
98340
|
+
if (result_14)
|
|
98341
|
+
return result_14;
|
|
98150
98342
|
}
|
|
98151
98343
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
98152
98344
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -98165,10 +98357,10 @@ var ts;
|
|
|
98165
98357
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
98166
98358
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
98167
98359
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
98168
|
-
var
|
|
98360
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
98169
98361
|
shouldFilterIgnoredPaths = true;
|
|
98170
|
-
if (
|
|
98171
|
-
return
|
|
98362
|
+
if (result_15)
|
|
98363
|
+
return result_15;
|
|
98172
98364
|
}
|
|
98173
98365
|
});
|
|
98174
98366
|
});
|