typescript 4.5.0-dev.20211027 → 4.5.0-dev.20211031
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 +280 -92
- package/lib/tsserver.js +612 -158
- package/lib/tsserverlibrary.d.ts +8 -0
- package/lib/tsserverlibrary.js +612 -158
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +608 -158
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +608 -158
- package/lib/typingsInstaller.js +340 -95
- 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.20211031";
|
|
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
|
}
|
|
@@ -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)) {
|
|
@@ -56045,8 +56118,10 @@ var ts;
|
|
|
56045
56118
|
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
|
|
56046
56119
|
switch (node.kind) {
|
|
56047
56120
|
case 79:
|
|
56048
|
-
|
|
56049
|
-
|
|
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
|
+
}
|
|
56050
56125
|
case 108:
|
|
56051
56126
|
return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
|
|
56052
56127
|
case 229:
|
|
@@ -62632,11 +62707,33 @@ var ts;
|
|
|
62632
62707
|
if (moduleSymbol) {
|
|
62633
62708
|
var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true, false);
|
|
62634
62709
|
if (esModuleSymbol) {
|
|
62635
|
-
return createPromiseReturnType(node,
|
|
62710
|
+
return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) ||
|
|
62711
|
+
getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
|
|
62636
62712
|
}
|
|
62637
62713
|
}
|
|
62638
62714
|
return createPromiseReturnType(node, anyType);
|
|
62639
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
|
+
}
|
|
62640
62737
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
62641
62738
|
var _a;
|
|
62642
62739
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
@@ -62645,14 +62742,8 @@ var ts;
|
|
|
62645
62742
|
var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
62646
62743
|
var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false, moduleSpecifier);
|
|
62647
62744
|
if (hasSyntheticDefault) {
|
|
62648
|
-
var memberTable = ts.createSymbolTable();
|
|
62649
|
-
var newSymbol = createSymbol(2097152, "default");
|
|
62650
|
-
newSymbol.parent = originalSymbol;
|
|
62651
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
62652
|
-
newSymbol.target = resolveSymbol(symbol);
|
|
62653
|
-
memberTable.set("default", newSymbol);
|
|
62654
62745
|
var anonymousSymbol = createSymbol(2048, "__type");
|
|
62655
|
-
var defaultContainingObject =
|
|
62746
|
+
var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
62656
62747
|
anonymousSymbol.type = defaultContainingObject;
|
|
62657
62748
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
62658
62749
|
}
|
|
@@ -63299,11 +63390,11 @@ var ts;
|
|
|
63299
63390
|
var operandType = getTypeOfExpression(node.expression.expression);
|
|
63300
63391
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, false);
|
|
63301
63392
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true);
|
|
63302
|
-
var
|
|
63303
|
-
if (
|
|
63393
|
+
var type_5 = getBaseConstraintOfType(operandType) || operandType;
|
|
63394
|
+
if (type_5.flags & 3) {
|
|
63304
63395
|
return (556800 & notEqualFacts_1) === 556800;
|
|
63305
63396
|
}
|
|
63306
|
-
return !!(filterType(
|
|
63397
|
+
return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
|
|
63307
63398
|
}
|
|
63308
63399
|
var type = getTypeOfExpression(node.expression);
|
|
63309
63400
|
if (!isLiteralType(type)) {
|
|
@@ -68336,7 +68427,7 @@ var ts;
|
|
|
68336
68427
|
checkKindsOfPropertyMemberOverrides(type, baseType_1);
|
|
68337
68428
|
}
|
|
68338
68429
|
}
|
|
68339
|
-
|
|
68430
|
+
checkMembersForOverrideModifier(node, type, typeWithThis, staticType);
|
|
68340
68431
|
var implementedTypeNodes = ts.getEffectiveImplementsTypeNodes(node);
|
|
68341
68432
|
if (implementedTypeNodes) {
|
|
68342
68433
|
for (var _b = 0, implementedTypeNodes_1 = implementedTypeNodes; _b < implementedTypeNodes_1.length; _b++) {
|
|
@@ -68371,8 +68462,7 @@ var ts;
|
|
|
68371
68462
|
checkPropertyInitialization(node);
|
|
68372
68463
|
}
|
|
68373
68464
|
}
|
|
68374
|
-
function
|
|
68375
|
-
var nodeInAmbientContext = !!(node.flags & 8388608);
|
|
68465
|
+
function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) {
|
|
68376
68466
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
|
|
68377
68467
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
68378
68468
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
@@ -68384,46 +68474,57 @@ var ts;
|
|
|
68384
68474
|
if (ts.isConstructorDeclaration(member)) {
|
|
68385
68475
|
ts.forEach(member.parameters, function (param) {
|
|
68386
68476
|
if (ts.isParameterPropertyDeclaration(param, member)) {
|
|
68387
|
-
|
|
68477
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, param, true);
|
|
68388
68478
|
}
|
|
68389
68479
|
});
|
|
68390
68480
|
}
|
|
68391
|
-
|
|
68481
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, false);
|
|
68392
68482
|
};
|
|
68393
68483
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
68394
68484
|
var member = _a[_i];
|
|
68395
68485
|
_loop_29(member);
|
|
68396
68486
|
}
|
|
68397
|
-
|
|
68398
|
-
|
|
68399
|
-
|
|
68400
|
-
|
|
68401
|
-
|
|
68402
|
-
|
|
68403
|
-
|
|
68404
|
-
|
|
68405
|
-
|
|
68406
|
-
|
|
68407
|
-
|
|
68408
|
-
|
|
68409
|
-
|
|
68410
|
-
|
|
68411
|
-
|
|
68412
|
-
|
|
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);
|
|
68413
68511
|
suggestion ?
|
|
68414
|
-
error(
|
|
68512
|
+
error(errorNode, isJs ?
|
|
68415
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 :
|
|
68416
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)) :
|
|
68417
|
-
error(
|
|
68515
|
+
error(errorNode, isJs ?
|
|
68418
68516
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
68419
68517
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
68420
68518
|
}
|
|
68421
|
-
|
|
68422
|
-
|
|
68423
|
-
|
|
68424
|
-
|
|
68425
|
-
|
|
68426
|
-
|
|
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) {
|
|
68427
68528
|
var diag = memberIsParameterProperty ?
|
|
68428
68529
|
isJs ?
|
|
68429
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 :
|
|
@@ -68431,20 +68532,28 @@ var ts;
|
|
|
68431
68532
|
isJs ?
|
|
68432
68533
|
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
68433
68534
|
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
68434
|
-
error(
|
|
68535
|
+
error(errorNode, diag, baseClassName);
|
|
68435
68536
|
}
|
|
68436
|
-
|
|
68437
|
-
|
|
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);
|
|
68438
68542
|
}
|
|
68543
|
+
return 1;
|
|
68439
68544
|
}
|
|
68440
68545
|
}
|
|
68441
|
-
|
|
68546
|
+
}
|
|
68547
|
+
else if (memberHasOverrideModifier) {
|
|
68548
|
+
if (errorNode) {
|
|
68442
68549
|
var className = typeToString(type);
|
|
68443
|
-
error(
|
|
68550
|
+
error(errorNode, isJs ?
|
|
68444
68551
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
68445
68552
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
68446
68553
|
}
|
|
68554
|
+
return 2;
|
|
68447
68555
|
}
|
|
68556
|
+
return 0;
|
|
68448
68557
|
}
|
|
68449
68558
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
68450
68559
|
var issuedMemberError = false;
|
|
@@ -68484,6 +68593,24 @@ var ts;
|
|
|
68484
68593
|
}
|
|
68485
68594
|
}
|
|
68486
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
|
+
}
|
|
68487
68614
|
function getTargetSymbol(s) {
|
|
68488
68615
|
return ts.getCheckFlags(s) & 1 ? s.target : s;
|
|
68489
68616
|
}
|
|
@@ -79161,11 +79288,11 @@ var ts;
|
|
|
79161
79288
|
currentFileState.filenameDeclaration = declaration;
|
|
79162
79289
|
return currentFileState.filenameDeclaration.name;
|
|
79163
79290
|
}
|
|
79164
|
-
function getJsxFactoryCalleePrimitive(
|
|
79165
|
-
return compilerOptions.jsx === 5 ? "jsxDEV" :
|
|
79291
|
+
function getJsxFactoryCalleePrimitive(isStaticChildren) {
|
|
79292
|
+
return compilerOptions.jsx === 5 ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
|
|
79166
79293
|
}
|
|
79167
|
-
function getJsxFactoryCallee(
|
|
79168
|
-
var type = getJsxFactoryCalleePrimitive(
|
|
79294
|
+
function getJsxFactoryCallee(isStaticChildren) {
|
|
79295
|
+
var type = getJsxFactoryCalleePrimitive(isStaticChildren);
|
|
79169
79296
|
return getImplicitImportForName(type);
|
|
79170
79297
|
}
|
|
79171
79298
|
function getImplicitJsxFragmentReference() {
|
|
@@ -79304,7 +79431,7 @@ var ts;
|
|
|
79304
79431
|
}
|
|
79305
79432
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
79306
79433
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79307
|
-
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
79434
|
+
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
79308
79435
|
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
79309
79436
|
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
79310
79437
|
}
|
|
@@ -79318,14 +79445,17 @@ var ts;
|
|
|
79318
79445
|
var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
|
|
79319
79446
|
var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
|
|
79320
79447
|
factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray);
|
|
79321
|
-
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr,
|
|
79448
|
+
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
|
|
79322
79449
|
}
|
|
79323
|
-
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);
|
|
79324
79454
|
var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
|
|
79325
79455
|
if (compilerOptions.jsx === 5) {
|
|
79326
79456
|
var originalFile = ts.getOriginalNode(currentSourceFile);
|
|
79327
79457
|
if (originalFile && ts.isSourceFile(originalFile)) {
|
|
79328
|
-
args.push(
|
|
79458
|
+
args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
|
|
79329
79459
|
var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
|
|
79330
79460
|
args.push(factory.createObjectLiteralExpression([
|
|
79331
79461
|
factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()),
|
|
@@ -79335,7 +79465,7 @@ var ts;
|
|
|
79335
79465
|
args.push(factory.createThis());
|
|
79336
79466
|
}
|
|
79337
79467
|
}
|
|
79338
|
-
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(
|
|
79468
|
+
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), undefined, args), location);
|
|
79339
79469
|
if (isChild) {
|
|
79340
79470
|
ts.startOnNewLine(element);
|
|
79341
79471
|
}
|
|
@@ -79363,7 +79493,7 @@ var ts;
|
|
|
79363
79493
|
childrenProps = result;
|
|
79364
79494
|
}
|
|
79365
79495
|
}
|
|
79366
|
-
return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), undefined,
|
|
79496
|
+
return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]), undefined, children, isChild, location);
|
|
79367
79497
|
}
|
|
79368
79498
|
function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
|
|
79369
79499
|
var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location);
|
|
@@ -88723,7 +88853,14 @@ var ts;
|
|
|
88723
88853
|
onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node);
|
|
88724
88854
|
currentParenthesizerRule = undefined;
|
|
88725
88855
|
}
|
|
88726
|
-
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
|
+
}
|
|
88727
88864
|
if (hint === 0)
|
|
88728
88865
|
return emitSourceFile(ts.cast(node, ts.isSourceFile));
|
|
88729
88866
|
if (hint === 2)
|
|
@@ -89272,6 +89409,24 @@ var ts;
|
|
|
89272
89409
|
bundleFileInfo.sections.push(section);
|
|
89273
89410
|
}
|
|
89274
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
|
+
}
|
|
89275
89430
|
function emitIdentifier(node) {
|
|
89276
89431
|
var writeText = node.symbol ? writeSymbol : write;
|
|
89277
89432
|
writeText(getTextOfNode(node, false), node.symbol);
|
|
@@ -91381,6 +91536,14 @@ var ts;
|
|
|
91381
91536
|
function writeProperty(s) {
|
|
91382
91537
|
writer.writeProperty(s);
|
|
91383
91538
|
}
|
|
91539
|
+
function nonEscapingWrite(s) {
|
|
91540
|
+
if (writer.nonEscapingWrite) {
|
|
91541
|
+
writer.nonEscapingWrite(s);
|
|
91542
|
+
}
|
|
91543
|
+
else {
|
|
91544
|
+
writer.write(s);
|
|
91545
|
+
}
|
|
91546
|
+
}
|
|
91384
91547
|
function writeLine(count) {
|
|
91385
91548
|
if (count === void 0) { count = 1; }
|
|
91386
91549
|
for (var i = 0; i < count; i++) {
|
|
@@ -94036,8 +94199,8 @@ var ts;
|
|
|
94036
94199
|
}
|
|
94037
94200
|
var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
|
|
94038
94201
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
94039
|
-
var
|
|
94040
|
-
if (
|
|
94202
|
+
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
94203
|
+
if (typeReferenceResolutionsChanged) {
|
|
94041
94204
|
structureIsReused = 1;
|
|
94042
94205
|
newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
|
|
94043
94206
|
}
|
|
@@ -95176,6 +95339,21 @@ var ts;
|
|
|
95176
95339
|
return resolvedRef;
|
|
95177
95340
|
}
|
|
95178
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
|
+
}
|
|
95179
95357
|
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
95180
95358
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
95181
95359
|
}
|
|
@@ -95319,7 +95497,9 @@ var ts;
|
|
|
95319
95497
|
}
|
|
95320
95498
|
}
|
|
95321
95499
|
if (options.resolveJsonModule) {
|
|
95322
|
-
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) {
|
|
95323
95503
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
95324
95504
|
}
|
|
95325
95505
|
else if (!ts.hasJsonModuleEmitEnabled(options)) {
|
|
@@ -95631,8 +95811,8 @@ var ts;
|
|
|
95631
95811
|
function createDiagnosticForOptionName(message, option1, option2, option3) {
|
|
95632
95812
|
createDiagnosticForOption(true, option1, option2, message, option1, option2, option3);
|
|
95633
95813
|
}
|
|
95634
|
-
function createOptionValueDiagnostic(option1, message, arg0) {
|
|
95635
|
-
createDiagnosticForOption(false, option1, undefined, message, arg0);
|
|
95814
|
+
function createOptionValueDiagnostic(option1, message, arg0, arg1) {
|
|
95815
|
+
createDiagnosticForOption(false, option1, undefined, message, arg0, arg1);
|
|
95636
95816
|
}
|
|
95637
95817
|
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
|
|
95638
95818
|
var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
|
|
@@ -97496,6 +97676,9 @@ var ts;
|
|
|
97496
97676
|
else {
|
|
97497
97677
|
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
97498
97678
|
perDirectoryResolution.set(name, mode, resolution);
|
|
97679
|
+
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
97680
|
+
resolutionHost.onDiscoveredSymlink();
|
|
97681
|
+
}
|
|
97499
97682
|
}
|
|
97500
97683
|
resolutionsInFile.set(name, mode, resolution);
|
|
97501
97684
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
@@ -97913,6 +98096,11 @@ var ts;
|
|
|
97913
98096
|
}
|
|
97914
98097
|
}
|
|
97915
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
|
+
}
|
|
97916
98104
|
})(ts || (ts = {}));
|
|
97917
98105
|
var ts;
|
|
97918
98106
|
(function (ts) {
|