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/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211031";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -2540,6 +2540,10 @@ var ts;
|
|
|
2540
2540
|
return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false);
|
|
2541
2541
|
}
|
|
2542
2542
|
Debug.formatSyntaxKind = formatSyntaxKind;
|
|
2543
|
+
function formatSnippetKind(kind) {
|
|
2544
|
+
return formatEnum(kind, ts.SnippetKind, /*isFlags*/ false);
|
|
2545
|
+
}
|
|
2546
|
+
Debug.formatSnippetKind = formatSnippetKind;
|
|
2543
2547
|
function formatNodeFlags(flags) {
|
|
2544
2548
|
return formatEnum(flags, ts.NodeFlags, /*isFlags*/ true);
|
|
2545
2549
|
}
|
|
@@ -4456,6 +4460,13 @@ var ts;
|
|
|
4456
4460
|
ExitStatus[ExitStatus["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped";
|
|
4457
4461
|
})(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {}));
|
|
4458
4462
|
/* @internal */
|
|
4463
|
+
var MemberOverrideStatus;
|
|
4464
|
+
(function (MemberOverrideStatus) {
|
|
4465
|
+
MemberOverrideStatus[MemberOverrideStatus["Ok"] = 0] = "Ok";
|
|
4466
|
+
MemberOverrideStatus[MemberOverrideStatus["NeedsOverride"] = 1] = "NeedsOverride";
|
|
4467
|
+
MemberOverrideStatus[MemberOverrideStatus["HasInvalidOverride"] = 2] = "HasInvalidOverride";
|
|
4468
|
+
})(MemberOverrideStatus = ts.MemberOverrideStatus || (ts.MemberOverrideStatus = {}));
|
|
4469
|
+
/* @internal */
|
|
4459
4470
|
var UnionReduction;
|
|
4460
4471
|
(function (UnionReduction) {
|
|
4461
4472
|
UnionReduction[UnionReduction["None"] = 0] = "None";
|
|
@@ -5104,7 +5115,7 @@ var ts;
|
|
|
5104
5115
|
(function (ModuleResolutionKind) {
|
|
5105
5116
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
5106
5117
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
5107
|
-
// Starting with node12, node's module resolver has significant departures from
|
|
5118
|
+
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
|
|
5108
5119
|
// to better support ecmascript modules and their use within node - more features are still being added, so
|
|
5109
5120
|
// we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12`
|
|
5110
5121
|
// version-anchored resolution target
|
|
@@ -5437,6 +5448,15 @@ var ts;
|
|
|
5437
5448
|
// Masks
|
|
5438
5449
|
// - Additional bitmasks
|
|
5439
5450
|
})(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {}));
|
|
5451
|
+
// Reference: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax
|
|
5452
|
+
/* @internal */
|
|
5453
|
+
var SnippetKind;
|
|
5454
|
+
(function (SnippetKind) {
|
|
5455
|
+
SnippetKind[SnippetKind["TabStop"] = 0] = "TabStop";
|
|
5456
|
+
SnippetKind[SnippetKind["Placeholder"] = 1] = "Placeholder";
|
|
5457
|
+
SnippetKind[SnippetKind["Choice"] = 2] = "Choice";
|
|
5458
|
+
SnippetKind[SnippetKind["Variable"] = 3] = "Variable";
|
|
5459
|
+
})(SnippetKind = ts.SnippetKind || (ts.SnippetKind = {}));
|
|
5440
5460
|
var EmitFlags;
|
|
5441
5461
|
(function (EmitFlags) {
|
|
5442
5462
|
EmitFlags[EmitFlags["None"] = 0] = "None";
|
|
@@ -8673,6 +8693,8 @@ var ts;
|
|
|
8673
8693
|
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'."),
|
|
8674
8694
|
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."),
|
|
8675
8695
|
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}'?"),
|
|
8696
|
+
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."),
|
|
8697
|
+
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}'?"),
|
|
8676
8698
|
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}'."),
|
|
8677
8699
|
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}'."),
|
|
8678
8700
|
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}'."),
|
|
@@ -8779,6 +8801,7 @@ var ts;
|
|
|
8779
8801
|
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."),
|
|
8780
8802
|
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}'."),
|
|
8781
8803
|
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}'?"),
|
|
8804
|
+
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'."),
|
|
8782
8805
|
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."),
|
|
8783
8806
|
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."),
|
|
8784
8807
|
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}'."),
|
|
@@ -9332,6 +9355,7 @@ var ts;
|
|
|
9332
9355
|
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."),
|
|
9333
9356
|
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."),
|
|
9334
9357
|
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."),
|
|
9358
|
+
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."),
|
|
9335
9359
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
9336
9360
|
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."),
|
|
9337
9361
|
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."),
|
|
@@ -9435,6 +9459,7 @@ var ts;
|
|
|
9435
9459
|
Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
|
|
9436
9460
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
9437
9461
|
Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
|
|
9462
|
+
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}'"),
|
|
9438
9463
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
9439
9464
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
9440
9465
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -19628,6 +19653,8 @@ var ts;
|
|
|
19628
19653
|
case ts.ModuleKind.ES2020:
|
|
19629
19654
|
case ts.ModuleKind.ES2022:
|
|
19630
19655
|
case ts.ModuleKind.ESNext:
|
|
19656
|
+
case ts.ModuleKind.Node12:
|
|
19657
|
+
case ts.ModuleKind.NodeNext:
|
|
19631
19658
|
return true;
|
|
19632
19659
|
default:
|
|
19633
19660
|
return false;
|
|
@@ -20739,6 +20766,10 @@ var ts;
|
|
|
20739
20766
|
return node.kind === 212 /* FunctionExpression */ || node.kind === 213 /* ArrowFunction */;
|
|
20740
20767
|
}
|
|
20741
20768
|
ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
|
|
20769
|
+
function escapeSnippetText(text) {
|
|
20770
|
+
return text.replace(/\$/gm, "\\$");
|
|
20771
|
+
}
|
|
20772
|
+
ts.escapeSnippetText = escapeSnippetText;
|
|
20742
20773
|
})(ts || (ts = {}));
|
|
20743
20774
|
/* @internal */
|
|
20744
20775
|
var ts;
|
|
@@ -26942,6 +26973,25 @@ var ts;
|
|
|
26942
26973
|
}
|
|
26943
26974
|
}
|
|
26944
26975
|
ts.moveEmitHelpers = moveEmitHelpers;
|
|
26976
|
+
/**
|
|
26977
|
+
* Gets the SnippetElement of a node.
|
|
26978
|
+
*/
|
|
26979
|
+
/* @internal */
|
|
26980
|
+
function getSnippetElement(node) {
|
|
26981
|
+
var _a;
|
|
26982
|
+
return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.snippetElement;
|
|
26983
|
+
}
|
|
26984
|
+
ts.getSnippetElement = getSnippetElement;
|
|
26985
|
+
/**
|
|
26986
|
+
* Sets the SnippetElement of a node.
|
|
26987
|
+
*/
|
|
26988
|
+
/* @internal */
|
|
26989
|
+
function setSnippetElement(node, snippet) {
|
|
26990
|
+
var emitNode = getOrCreateEmitNode(node);
|
|
26991
|
+
emitNode.snippetElement = snippet;
|
|
26992
|
+
return node;
|
|
26993
|
+
}
|
|
26994
|
+
ts.setSnippetElement = setSnippetElement;
|
|
26945
26995
|
/* @internal */
|
|
26946
26996
|
function ignoreSourceNewlines(node) {
|
|
26947
26997
|
getOrCreateEmitNode(node).flags |= 134217728 /* IgnoreSourceNewlines */;
|
|
@@ -47067,6 +47117,7 @@ var ts;
|
|
|
47067
47117
|
isDeclarationVisible: isDeclarationVisible,
|
|
47068
47118
|
isPropertyAccessible: isPropertyAccessible,
|
|
47069
47119
|
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
47120
|
+
getMemberOverrideModifierStatus: getMemberOverrideModifierStatus,
|
|
47070
47121
|
};
|
|
47071
47122
|
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
|
|
47072
47123
|
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
|
|
@@ -47310,6 +47361,21 @@ var ts;
|
|
|
47310
47361
|
var enumRelation = new ts.Map();
|
|
47311
47362
|
var builtinGlobals = ts.createSymbolTable();
|
|
47312
47363
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
47364
|
+
// Extensions suggested for path imports when module resolution is node12 or higher.
|
|
47365
|
+
// The first element of each tuple is the extension a file has.
|
|
47366
|
+
// The second element of each tuple is the extension that should be used in a path import.
|
|
47367
|
+
// e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
|
|
47368
|
+
var suggestedExtensions = [
|
|
47369
|
+
[".mts", ".mjs"],
|
|
47370
|
+
[".ts", ".js"],
|
|
47371
|
+
[".cts", ".cjs"],
|
|
47372
|
+
[".mjs", ".mjs"],
|
|
47373
|
+
[".js", ".js"],
|
|
47374
|
+
[".cjs", ".cjs"],
|
|
47375
|
+
[".tsx", compilerOptions.jsx === 1 /* Preserve */ ? ".jsx" : ".js"],
|
|
47376
|
+
[".jsx", ".jsx"],
|
|
47377
|
+
[".json", ".json"],
|
|
47378
|
+
];
|
|
47313
47379
|
initializeTypeChecker();
|
|
47314
47380
|
return checker;
|
|
47315
47381
|
function getJsxNamespace(location) {
|
|
@@ -48813,6 +48879,10 @@ var ts;
|
|
|
48813
48879
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
48814
48880
|
return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
|
|
48815
48881
|
}
|
|
48882
|
+
function isOnlyImportedAsDefault(usage) {
|
|
48883
|
+
var usageMode = getUsageModeForExpression(usage);
|
|
48884
|
+
return usageMode === ts.ModuleKind.ESNext && ts.endsWith(usage.text, ".json" /* Json */);
|
|
48885
|
+
}
|
|
48816
48886
|
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
48817
48887
|
var usageMode = file && getUsageModeForExpression(usage);
|
|
48818
48888
|
if (file && usageMode !== undefined) {
|
|
@@ -48863,8 +48933,9 @@ var ts;
|
|
|
48863
48933
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, node, dontResolveAlias);
|
|
48864
48934
|
}
|
|
48865
48935
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
48936
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(node.parent.moduleSpecifier);
|
|
48866
48937
|
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
|
|
48867
|
-
if (!exportDefaultSymbol && !hasSyntheticDefault) {
|
|
48938
|
+
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
48868
48939
|
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
48869
48940
|
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
48870
48941
|
var exportEqualsSymbol = moduleSymbol.exports.get("export=" /* ExportEquals */);
|
|
@@ -48878,7 +48949,7 @@ var ts;
|
|
|
48878
48949
|
reportNonDefaultExport(moduleSymbol, node);
|
|
48879
48950
|
}
|
|
48880
48951
|
}
|
|
48881
|
-
else if (hasSyntheticDefault) {
|
|
48952
|
+
else if (hasSyntheticDefault || hasDefaultOnly) {
|
|
48882
48953
|
// per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present
|
|
48883
48954
|
var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
48884
48955
|
markSymbolOfAliasDeclarationIfTypeOnly(node, moduleSymbol, resolved, /*overwriteTypeOnly*/ false);
|
|
@@ -49003,7 +49074,7 @@ var ts;
|
|
|
49003
49074
|
var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
49004
49075
|
if (symbolFromModule === undefined && name.escapedText === "default" /* Default */) {
|
|
49005
49076
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
49006
|
-
if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
49077
|
+
if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
49007
49078
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
49008
49079
|
}
|
|
49009
49080
|
}
|
|
@@ -49520,7 +49591,7 @@ var ts;
|
|
|
49520
49591
|
: undefined;
|
|
49521
49592
|
}
|
|
49522
49593
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
|
|
49523
|
-
var _a, _b, _c, _d, _e, _f;
|
|
49594
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
49524
49595
|
if (isForAugmentation === void 0) { isForAugmentation = false; }
|
|
49525
49596
|
if (ts.startsWith(moduleReference, "@types/")) {
|
|
49526
49597
|
var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
@@ -49541,7 +49612,7 @@ var ts;
|
|
|
49541
49612
|
((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
|
|
49542
49613
|
((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
|
|
49543
49614
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
49544
|
-
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
49615
|
+
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
49545
49616
|
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
49546
49617
|
var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
49547
49618
|
if (sourceFile) {
|
|
@@ -49554,6 +49625,9 @@ var ts;
|
|
|
49554
49625
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
49555
49626
|
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);
|
|
49556
49627
|
}
|
|
49628
|
+
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
49629
|
+
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
49630
|
+
}
|
|
49557
49631
|
}
|
|
49558
49632
|
// merged symbol is module declaration symbol combined with all augmentations
|
|
49559
49633
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -49604,6 +49678,10 @@ var ts;
|
|
|
49604
49678
|
}
|
|
49605
49679
|
else {
|
|
49606
49680
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
49681
|
+
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
49682
|
+
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
49683
|
+
var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
|
|
49684
|
+
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
49607
49685
|
if (tsExtension) {
|
|
49608
49686
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
49609
49687
|
var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
|
|
@@ -49623,6 +49701,19 @@ var ts;
|
|
|
49623
49701
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
49624
49702
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
49625
49703
|
}
|
|
49704
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
|
|
49705
|
+
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
49706
|
+
var suggestedExt = (_g = suggestedExtensions.find(function (_a) {
|
|
49707
|
+
var actualExt = _a[0], _importExt = _a[1];
|
|
49708
|
+
return host.fileExists(absoluteRef_1 + actualExt);
|
|
49709
|
+
})) === null || _g === void 0 ? void 0 : _g[1];
|
|
49710
|
+
if (suggestedExt) {
|
|
49711
|
+
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);
|
|
49712
|
+
}
|
|
49713
|
+
else {
|
|
49714
|
+
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);
|
|
49715
|
+
}
|
|
49716
|
+
}
|
|
49626
49717
|
else {
|
|
49627
49718
|
error(errorNode, moduleNotFoundError, moduleReference);
|
|
49628
49719
|
}
|
|
@@ -49692,40 +49783,50 @@ var ts;
|
|
|
49692
49783
|
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);
|
|
49693
49784
|
return symbol;
|
|
49694
49785
|
}
|
|
49695
|
-
|
|
49696
|
-
|
|
49697
|
-
|
|
49698
|
-
|
|
49699
|
-
|
|
49786
|
+
var referenceParent = referencingLocation.parent;
|
|
49787
|
+
if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) ||
|
|
49788
|
+
ts.isImportCall(referenceParent)) {
|
|
49789
|
+
var reference = ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier;
|
|
49790
|
+
var type = getTypeOfSymbol(symbol);
|
|
49791
|
+
var defaultOnlyType = getTypeWithSyntheticDefaultOnly(type, symbol, moduleSymbol, reference);
|
|
49792
|
+
if (defaultOnlyType) {
|
|
49793
|
+
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
49794
|
+
}
|
|
49795
|
+
if (ts.getESModuleInterop(compilerOptions)) {
|
|
49700
49796
|
var sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
49701
49797
|
if (!sigs || !sigs.length) {
|
|
49702
49798
|
sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);
|
|
49703
49799
|
}
|
|
49704
|
-
if (sigs && sigs.length) {
|
|
49705
|
-
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol,
|
|
49706
|
-
|
|
49707
|
-
var result = createSymbol(symbol.flags, symbol.escapedName);
|
|
49708
|
-
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
49709
|
-
result.parent = symbol.parent;
|
|
49710
|
-
result.target = symbol;
|
|
49711
|
-
result.originatingImport = referenceParent;
|
|
49712
|
-
if (symbol.valueDeclaration)
|
|
49713
|
-
result.valueDeclaration = symbol.valueDeclaration;
|
|
49714
|
-
if (symbol.constEnumOnlyModule)
|
|
49715
|
-
result.constEnumOnlyModule = true;
|
|
49716
|
-
if (symbol.members)
|
|
49717
|
-
result.members = new ts.Map(symbol.members);
|
|
49718
|
-
if (symbol.exports)
|
|
49719
|
-
result.exports = new ts.Map(symbol.exports);
|
|
49720
|
-
var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above
|
|
49721
|
-
result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
|
|
49722
|
-
return result;
|
|
49800
|
+
if ((sigs && sigs.length) || getPropertyOfType(type, "default" /* Default */)) {
|
|
49801
|
+
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
49802
|
+
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
49723
49803
|
}
|
|
49724
49804
|
}
|
|
49725
49805
|
}
|
|
49726
49806
|
}
|
|
49727
49807
|
return symbol;
|
|
49728
49808
|
}
|
|
49809
|
+
/**
|
|
49810
|
+
* Create a new symbol which has the module's type less the call and construct signatures
|
|
49811
|
+
*/
|
|
49812
|
+
function cloneTypeAsModuleType(symbol, moduleType, referenceParent) {
|
|
49813
|
+
var result = createSymbol(symbol.flags, symbol.escapedName);
|
|
49814
|
+
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
49815
|
+
result.parent = symbol.parent;
|
|
49816
|
+
result.target = symbol;
|
|
49817
|
+
result.originatingImport = referenceParent;
|
|
49818
|
+
if (symbol.valueDeclaration)
|
|
49819
|
+
result.valueDeclaration = symbol.valueDeclaration;
|
|
49820
|
+
if (symbol.constEnumOnlyModule)
|
|
49821
|
+
result.constEnumOnlyModule = true;
|
|
49822
|
+
if (symbol.members)
|
|
49823
|
+
result.members = new ts.Map(symbol.members);
|
|
49824
|
+
if (symbol.exports)
|
|
49825
|
+
result.exports = new ts.Map(symbol.exports);
|
|
49826
|
+
var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above
|
|
49827
|
+
result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.indexInfos);
|
|
49828
|
+
return result;
|
|
49829
|
+
}
|
|
49729
49830
|
function hasExportAssignmentSymbol(moduleSymbol) {
|
|
49730
49831
|
return moduleSymbol.exports.get("export=" /* ExportEquals */) !== undefined;
|
|
49731
49832
|
}
|
|
@@ -61524,7 +61625,9 @@ var ts;
|
|
|
61524
61625
|
return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
|
|
61525
61626
|
if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
|
|
61526
61627
|
if (!type.declaration.nameType) {
|
|
61527
|
-
|
|
61628
|
+
var constraint = void 0;
|
|
61629
|
+
if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 &&
|
|
61630
|
+
(constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
|
|
61528
61631
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
61529
61632
|
}
|
|
61530
61633
|
if (isGenericTupleType(t)) {
|
|
@@ -67171,8 +67274,11 @@ var ts;
|
|
|
67171
67274
|
function getFlowCacheKey(node, declaredType, initialType, flowContainer) {
|
|
67172
67275
|
switch (node.kind) {
|
|
67173
67276
|
case 79 /* Identifier */:
|
|
67174
|
-
|
|
67175
|
-
|
|
67277
|
+
if (!ts.isThisInTypeQuery(node)) {
|
|
67278
|
+
var symbol = getResolvedSymbol(node);
|
|
67279
|
+
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
|
|
67280
|
+
}
|
|
67281
|
+
// falls through
|
|
67176
67282
|
case 108 /* ThisKeyword */:
|
|
67177
67283
|
return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
|
|
67178
67284
|
case 229 /* NonNullExpression */:
|
|
@@ -74901,11 +75007,33 @@ var ts;
|
|
|
74901
75007
|
if (moduleSymbol) {
|
|
74902
75008
|
var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true, /*suppressUsageError*/ false);
|
|
74903
75009
|
if (esModuleSymbol) {
|
|
74904
|
-
return createPromiseReturnType(node,
|
|
75010
|
+
return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) ||
|
|
75011
|
+
getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
|
|
74905
75012
|
}
|
|
74906
75013
|
}
|
|
74907
75014
|
return createPromiseReturnType(node, anyType);
|
|
74908
75015
|
}
|
|
75016
|
+
function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) {
|
|
75017
|
+
var memberTable = ts.createSymbolTable();
|
|
75018
|
+
var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
75019
|
+
newSymbol.parent = originalSymbol;
|
|
75020
|
+
newSymbol.nameType = getStringLiteralType("default");
|
|
75021
|
+
newSymbol.target = resolveSymbol(symbol);
|
|
75022
|
+
memberTable.set("default" /* Default */, newSymbol);
|
|
75023
|
+
return createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
75024
|
+
}
|
|
75025
|
+
function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) {
|
|
75026
|
+
var hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier);
|
|
75027
|
+
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
75028
|
+
var synthType = type;
|
|
75029
|
+
if (!synthType.defaultOnlyType) {
|
|
75030
|
+
var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
75031
|
+
synthType.defaultOnlyType = type_4;
|
|
75032
|
+
}
|
|
75033
|
+
return synthType.defaultOnlyType;
|
|
75034
|
+
}
|
|
75035
|
+
return undefined;
|
|
75036
|
+
}
|
|
74909
75037
|
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
74910
75038
|
var _a;
|
|
74911
75039
|
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
@@ -74914,14 +75042,8 @@ var ts;
|
|
|
74914
75042
|
var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
74915
75043
|
var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false, moduleSpecifier);
|
|
74916
75044
|
if (hasSyntheticDefault) {
|
|
74917
|
-
var memberTable = ts.createSymbolTable();
|
|
74918
|
-
var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
74919
|
-
newSymbol.parent = originalSymbol;
|
|
74920
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
74921
|
-
newSymbol.target = resolveSymbol(symbol);
|
|
74922
|
-
memberTable.set("default" /* Default */, newSymbol);
|
|
74923
75045
|
var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
74924
|
-
var defaultContainingObject =
|
|
75046
|
+
var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
74925
75047
|
anonymousSymbol.type = defaultContainingObject;
|
|
74926
75048
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*objectFlags*/ 0, /*readonly*/ false) : defaultContainingObject;
|
|
74927
75049
|
}
|
|
@@ -75629,12 +75751,12 @@ var ts;
|
|
|
75629
75751
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false);
|
|
75630
75752
|
// notEqualFacts states that the type of the switched value is not equal to every type in the switch.
|
|
75631
75753
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true);
|
|
75632
|
-
var
|
|
75754
|
+
var type_5 = getBaseConstraintOfType(operandType) || operandType;
|
|
75633
75755
|
// Take any/unknown as a special condition. Or maybe we could change `type` to a union containing all primitive types.
|
|
75634
|
-
if (
|
|
75756
|
+
if (type_5.flags & 3 /* AnyOrUnknown */) {
|
|
75635
75757
|
return (556800 /* AllTypeofNE */ & notEqualFacts_1) === 556800 /* AllTypeofNE */;
|
|
75636
75758
|
}
|
|
75637
|
-
return !!(filterType(
|
|
75759
|
+
return !!(filterType(type_5, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);
|
|
75638
75760
|
}
|
|
75639
75761
|
var type = getTypeOfExpression(node.expression);
|
|
75640
75762
|
if (!isLiteralType(type)) {
|
|
@@ -81604,7 +81726,7 @@ var ts;
|
|
|
81604
81726
|
checkKindsOfPropertyMemberOverrides(type, baseType_1);
|
|
81605
81727
|
}
|
|
81606
81728
|
}
|
|
81607
|
-
|
|
81729
|
+
checkMembersForOverrideModifier(node, type, typeWithThis, staticType);
|
|
81608
81730
|
var implementedTypeNodes = ts.getEffectiveImplementsTypeNodes(node);
|
|
81609
81731
|
if (implementedTypeNodes) {
|
|
81610
81732
|
for (var _b = 0, implementedTypeNodes_1 = implementedTypeNodes; _b < implementedTypeNodes_1.length; _b++) {
|
|
@@ -81639,8 +81761,7 @@ var ts;
|
|
|
81639
81761
|
checkPropertyInitialization(node);
|
|
81640
81762
|
}
|
|
81641
81763
|
}
|
|
81642
|
-
function
|
|
81643
|
-
var nodeInAmbientContext = !!(node.flags & 8388608 /* Ambient */);
|
|
81764
|
+
function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) {
|
|
81644
81765
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
|
|
81645
81766
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
81646
81767
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
@@ -81652,46 +81773,71 @@ var ts;
|
|
|
81652
81773
|
if (ts.isConstructorDeclaration(member)) {
|
|
81653
81774
|
ts.forEach(member.parameters, function (param) {
|
|
81654
81775
|
if (ts.isParameterPropertyDeclaration(param, member)) {
|
|
81655
|
-
|
|
81776
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, param,
|
|
81777
|
+
/* memberIsParameterProperty */ true);
|
|
81656
81778
|
}
|
|
81657
81779
|
});
|
|
81658
81780
|
}
|
|
81659
|
-
|
|
81781
|
+
checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member,
|
|
81782
|
+
/* memberIsParameterProperty */ false);
|
|
81660
81783
|
};
|
|
81661
81784
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
81662
81785
|
var member = _a[_i];
|
|
81663
81786
|
_loop_29(member);
|
|
81664
81787
|
}
|
|
81665
|
-
|
|
81666
|
-
|
|
81667
|
-
|
|
81668
|
-
|
|
81669
|
-
|
|
81670
|
-
|
|
81671
|
-
|
|
81672
|
-
|
|
81673
|
-
|
|
81674
|
-
|
|
81675
|
-
|
|
81676
|
-
|
|
81677
|
-
|
|
81678
|
-
|
|
81679
|
-
|
|
81680
|
-
|
|
81788
|
+
}
|
|
81789
|
+
/**
|
|
81790
|
+
* @param member Existing member node to be checked.
|
|
81791
|
+
* Note: `member` cannot be a synthetic node.
|
|
81792
|
+
*/
|
|
81793
|
+
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
81794
|
+
if (reportErrors === void 0) { reportErrors = true; }
|
|
81795
|
+
var declaredProp = member.name
|
|
81796
|
+
&& getSymbolAtLocation(member.name)
|
|
81797
|
+
|| getSymbolAtLocation(member);
|
|
81798
|
+
if (!declaredProp) {
|
|
81799
|
+
return 0 /* Ok */;
|
|
81800
|
+
}
|
|
81801
|
+
return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, ts.hasOverrideModifier(member), ts.hasAbstractModifier(member), ts.isStatic(member), memberIsParameterProperty, ts.symbolName(declaredProp), reportErrors ? member : undefined);
|
|
81802
|
+
}
|
|
81803
|
+
/**
|
|
81804
|
+
* Checks a class member declaration for either a missing or an invalid `override` modifier.
|
|
81805
|
+
* Note: this function can be used for speculative checking,
|
|
81806
|
+
* i.e. checking a member that does not yet exist in the program.
|
|
81807
|
+
* An example of that would be to call this function in a completions scenario,
|
|
81808
|
+
* when offering a method declaration as completion.
|
|
81809
|
+
* @param errorNode The node where we should report an error, or undefined if we should not report errors.
|
|
81810
|
+
*/
|
|
81811
|
+
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) {
|
|
81812
|
+
var isJs = ts.isInJSFile(node);
|
|
81813
|
+
var nodeInAmbientContext = !!(node.flags & 8388608 /* Ambient */);
|
|
81814
|
+
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
81815
|
+
var memberEscapedName = ts.escapeLeadingUnderscores(memberName);
|
|
81816
|
+
var thisType = memberIsStatic ? staticType : typeWithThis;
|
|
81817
|
+
var baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
81818
|
+
var prop = getPropertyOfType(thisType, memberEscapedName);
|
|
81819
|
+
var baseProp = getPropertyOfType(baseType, memberEscapedName);
|
|
81820
|
+
var baseClassName = typeToString(baseWithThis);
|
|
81821
|
+
if (prop && !baseProp && memberHasOverrideModifier) {
|
|
81822
|
+
if (errorNode) {
|
|
81823
|
+
var suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType); // Again, using symbol name: note that's different from `symbol.escapedName`
|
|
81681
81824
|
suggestion ?
|
|
81682
|
-
error(
|
|
81825
|
+
error(errorNode, isJs ?
|
|
81683
81826
|
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 :
|
|
81684
81827
|
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)) :
|
|
81685
|
-
error(
|
|
81828
|
+
error(errorNode, isJs ?
|
|
81686
81829
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
81687
81830
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
81688
81831
|
}
|
|
81689
|
-
|
|
81690
|
-
|
|
81691
|
-
|
|
81692
|
-
|
|
81693
|
-
|
|
81694
|
-
|
|
81832
|
+
return 2 /* HasInvalidOverride */;
|
|
81833
|
+
}
|
|
81834
|
+
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
81835
|
+
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
81836
|
+
if (memberHasOverrideModifier) {
|
|
81837
|
+
return 0 /* Ok */;
|
|
81838
|
+
}
|
|
81839
|
+
if (!baseHasAbstract) {
|
|
81840
|
+
if (errorNode) {
|
|
81695
81841
|
var diag = memberIsParameterProperty ?
|
|
81696
81842
|
isJs ?
|
|
81697
81843
|
ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
@@ -81699,20 +81845,28 @@ var ts;
|
|
|
81699
81845
|
isJs ?
|
|
81700
81846
|
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
81701
81847
|
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
81702
|
-
error(
|
|
81848
|
+
error(errorNode, diag, baseClassName);
|
|
81703
81849
|
}
|
|
81704
|
-
|
|
81705
|
-
|
|
81850
|
+
return 1 /* NeedsOverride */;
|
|
81851
|
+
}
|
|
81852
|
+
else if (memberHasAbstractModifier && baseHasAbstract) {
|
|
81853
|
+
if (errorNode) {
|
|
81854
|
+
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);
|
|
81706
81855
|
}
|
|
81856
|
+
return 1 /* NeedsOverride */;
|
|
81707
81857
|
}
|
|
81708
81858
|
}
|
|
81709
|
-
|
|
81859
|
+
}
|
|
81860
|
+
else if (memberHasOverrideModifier) {
|
|
81861
|
+
if (errorNode) {
|
|
81710
81862
|
var className = typeToString(type);
|
|
81711
|
-
error(
|
|
81863
|
+
error(errorNode, isJs ?
|
|
81712
81864
|
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
81713
81865
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
81714
81866
|
}
|
|
81867
|
+
return 2 /* HasInvalidOverride */;
|
|
81715
81868
|
}
|
|
81869
|
+
return 0 /* Ok */;
|
|
81716
81870
|
}
|
|
81717
81871
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
81718
81872
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
@@ -81755,6 +81909,31 @@ var ts;
|
|
|
81755
81909
|
}
|
|
81756
81910
|
}
|
|
81757
81911
|
}
|
|
81912
|
+
/**
|
|
81913
|
+
* Checks a member declaration node to see if has a missing or invalid `override` modifier.
|
|
81914
|
+
* @param node Class-like node where the member is declared.
|
|
81915
|
+
* @param member Member declaration node.
|
|
81916
|
+
* Note: `member` can be a synthetic node without a parent.
|
|
81917
|
+
*/
|
|
81918
|
+
function getMemberOverrideModifierStatus(node, member) {
|
|
81919
|
+
if (!member.name) {
|
|
81920
|
+
return 0 /* Ok */;
|
|
81921
|
+
}
|
|
81922
|
+
var symbol = getSymbolOfNode(node);
|
|
81923
|
+
var type = getDeclaredTypeOfSymbol(symbol);
|
|
81924
|
+
var typeWithThis = getTypeWithThisArgument(type);
|
|
81925
|
+
var staticType = getTypeOfSymbol(symbol);
|
|
81926
|
+
var baseTypeNode = ts.getEffectiveBaseTypeNode(node);
|
|
81927
|
+
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
81928
|
+
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
81929
|
+
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
81930
|
+
var memberHasOverrideModifier = member.parent
|
|
81931
|
+
? ts.hasOverrideModifier(member)
|
|
81932
|
+
: ts.hasSyntacticModifier(member, 16384 /* Override */);
|
|
81933
|
+
var memberName = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(member.name));
|
|
81934
|
+
return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, ts.hasAbstractModifier(member), ts.isStatic(member),
|
|
81935
|
+
/* memberIsParameterProperty */ false, memberName);
|
|
81936
|
+
}
|
|
81758
81937
|
function getTargetSymbol(s) {
|
|
81759
81938
|
// if symbol is instantiated its flags are not copied from the 'target'
|
|
81760
81939
|
// so we'll need to get back original 'target' symbol to work with correct set of flags
|
|
@@ -94751,11 +94930,11 @@ var ts;
|
|
|
94751
94930
|
currentFileState.filenameDeclaration = declaration;
|
|
94752
94931
|
return currentFileState.filenameDeclaration.name;
|
|
94753
94932
|
}
|
|
94754
|
-
function getJsxFactoryCalleePrimitive(
|
|
94755
|
-
return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" :
|
|
94933
|
+
function getJsxFactoryCalleePrimitive(isStaticChildren) {
|
|
94934
|
+
return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
|
|
94756
94935
|
}
|
|
94757
|
-
function getJsxFactoryCallee(
|
|
94758
|
-
var type = getJsxFactoryCalleePrimitive(
|
|
94936
|
+
function getJsxFactoryCallee(isStaticChildren) {
|
|
94937
|
+
var type = getJsxFactoryCalleePrimitive(isStaticChildren);
|
|
94759
94938
|
return getImplicitImportForName(type);
|
|
94760
94939
|
}
|
|
94761
94940
|
function getImplicitJsxFragmentReference() {
|
|
@@ -94907,7 +95086,7 @@ var ts;
|
|
|
94907
95086
|
}
|
|
94908
95087
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
94909
95088
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
94910
|
-
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
95089
|
+
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
94911
95090
|
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
94912
95091
|
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
94913
95092
|
}
|
|
@@ -94921,15 +95100,18 @@ var ts;
|
|
|
94921
95100
|
var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
|
|
94922
95101
|
var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
|
|
94923
95102
|
factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray); // When there are no attributes, React wants {}
|
|
94924
|
-
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr,
|
|
95103
|
+
return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
|
|
94925
95104
|
}
|
|
94926
|
-
function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr,
|
|
95105
|
+
function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) {
|
|
95106
|
+
var _a;
|
|
95107
|
+
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95108
|
+
var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
|
|
94927
95109
|
var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
|
|
94928
95110
|
if (compilerOptions.jsx === 5 /* ReactJSXDev */) {
|
|
94929
95111
|
var originalFile = ts.getOriginalNode(currentSourceFile);
|
|
94930
95112
|
if (originalFile && ts.isSourceFile(originalFile)) {
|
|
94931
95113
|
// isStaticChildren development flag
|
|
94932
|
-
args.push(
|
|
95114
|
+
args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
|
|
94933
95115
|
// __source development flag
|
|
94934
95116
|
var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
|
|
94935
95117
|
args.push(factory.createObjectLiteralExpression([
|
|
@@ -94941,7 +95123,7 @@ var ts;
|
|
|
94941
95123
|
args.push(factory.createThis());
|
|
94942
95124
|
}
|
|
94943
95125
|
}
|
|
94944
|
-
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(
|
|
95126
|
+
var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), /*typeArguments*/ undefined, args), location);
|
|
94945
95127
|
if (isChild) {
|
|
94946
95128
|
ts.startOnNewLine(element);
|
|
94947
95129
|
}
|
|
@@ -94971,7 +95153,7 @@ var ts;
|
|
|
94971
95153
|
}
|
|
94972
95154
|
}
|
|
94973
95155
|
return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]),
|
|
94974
|
-
/*keyAttr*/ undefined,
|
|
95156
|
+
/*keyAttr*/ undefined, children, isChild, location);
|
|
94975
95157
|
}
|
|
94976
95158
|
function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
|
|
94977
95159
|
var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
|
|
@@ -108059,7 +108241,14 @@ var ts;
|
|
|
108059
108241
|
// clear the parenthesizer rule as we ascend
|
|
108060
108242
|
currentParenthesizerRule = undefined;
|
|
108061
108243
|
}
|
|
108062
|
-
function pipelineEmitWithHintWorker(hint, node) {
|
|
108244
|
+
function pipelineEmitWithHintWorker(hint, node, allowSnippets) {
|
|
108245
|
+
if (allowSnippets === void 0) { allowSnippets = true; }
|
|
108246
|
+
if (allowSnippets) {
|
|
108247
|
+
var snippet = ts.getSnippetElement(node);
|
|
108248
|
+
if (snippet) {
|
|
108249
|
+
return emitSnippetNode(hint, node, snippet);
|
|
108250
|
+
}
|
|
108251
|
+
}
|
|
108063
108252
|
if (hint === 0 /* SourceFile */)
|
|
108064
108253
|
return emitSourceFile(ts.cast(node, ts.isSourceFile));
|
|
108065
108254
|
if (hint === 2 /* IdentifierName */)
|
|
@@ -108668,6 +108857,28 @@ var ts;
|
|
|
108668
108857
|
}
|
|
108669
108858
|
}
|
|
108670
108859
|
//
|
|
108860
|
+
// Snippet Elements
|
|
108861
|
+
//
|
|
108862
|
+
function emitSnippetNode(hint, node, snippet) {
|
|
108863
|
+
switch (snippet.kind) {
|
|
108864
|
+
case 1 /* Placeholder */:
|
|
108865
|
+
emitPlaceholder(hint, node, snippet);
|
|
108866
|
+
break;
|
|
108867
|
+
case 0 /* TabStop */:
|
|
108868
|
+
emitTabStop(snippet);
|
|
108869
|
+
break;
|
|
108870
|
+
}
|
|
108871
|
+
}
|
|
108872
|
+
function emitPlaceholder(hint, node, snippet) {
|
|
108873
|
+
nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
|
|
108874
|
+
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
108875
|
+
nonEscapingWrite("}"); // `}`
|
|
108876
|
+
// `${2:...}`
|
|
108877
|
+
}
|
|
108878
|
+
function emitTabStop(snippet) {
|
|
108879
|
+
nonEscapingWrite("$" + snippet.order);
|
|
108880
|
+
}
|
|
108881
|
+
//
|
|
108671
108882
|
// Identifiers
|
|
108672
108883
|
//
|
|
108673
108884
|
function emitIdentifier(node) {
|
|
@@ -110906,6 +111117,15 @@ var ts;
|
|
|
110906
111117
|
function writeProperty(s) {
|
|
110907
111118
|
writer.writeProperty(s);
|
|
110908
111119
|
}
|
|
111120
|
+
function nonEscapingWrite(s) {
|
|
111121
|
+
// This should be defined in a snippet-escaping text writer.
|
|
111122
|
+
if (writer.nonEscapingWrite) {
|
|
111123
|
+
writer.nonEscapingWrite(s);
|
|
111124
|
+
}
|
|
111125
|
+
else {
|
|
111126
|
+
writer.write(s);
|
|
111127
|
+
}
|
|
111128
|
+
}
|
|
110909
111129
|
function writeLine(count) {
|
|
110910
111130
|
if (count === void 0) { count = 1; }
|
|
110911
111131
|
for (var i = 0; i < count; i++) {
|
|
@@ -114009,8 +114229,8 @@ var ts;
|
|
|
114009
114229
|
var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
|
|
114010
114230
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
114011
114231
|
// ensure that types resolutions are still correct
|
|
114012
|
-
var
|
|
114013
|
-
if (
|
|
114232
|
+
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
114233
|
+
if (typeReferenceResolutionsChanged) {
|
|
114014
114234
|
structureIsReused = 1 /* SafeModules */;
|
|
114015
114235
|
newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
|
|
114016
114236
|
}
|
|
@@ -115298,6 +115518,21 @@ var ts;
|
|
|
115298
115518
|
return resolvedRef;
|
|
115299
115519
|
}
|
|
115300
115520
|
function verifyCompilerOptions() {
|
|
115521
|
+
var isNightly = ts.stringContains(ts.version, "-dev");
|
|
115522
|
+
if (!isNightly) {
|
|
115523
|
+
if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
|
|
115524
|
+
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");
|
|
115525
|
+
}
|
|
115526
|
+
else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
|
|
115527
|
+
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");
|
|
115528
|
+
}
|
|
115529
|
+
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
|
|
115530
|
+
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");
|
|
115531
|
+
}
|
|
115532
|
+
else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
115533
|
+
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");
|
|
115534
|
+
}
|
|
115535
|
+
}
|
|
115301
115536
|
if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
|
|
115302
115537
|
createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
|
|
115303
115538
|
}
|
|
@@ -115446,7 +115681,9 @@ var ts;
|
|
|
115446
115681
|
}
|
|
115447
115682
|
}
|
|
115448
115683
|
if (options.resolveJsonModule) {
|
|
115449
|
-
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs
|
|
115684
|
+
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
115685
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 &&
|
|
115686
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
115450
115687
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
115451
115688
|
}
|
|
115452
115689
|
// Any emit other than common js, amd, es2015 or esnext is error
|
|
@@ -115774,8 +116011,8 @@ var ts;
|
|
|
115774
116011
|
function createDiagnosticForOptionName(message, option1, option2, option3) {
|
|
115775
116012
|
createDiagnosticForOption(/*onKey*/ true, option1, option2, message, option1, option2, option3);
|
|
115776
116013
|
}
|
|
115777
|
-
function createOptionValueDiagnostic(option1, message, arg0) {
|
|
115778
|
-
createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0);
|
|
116014
|
+
function createOptionValueDiagnostic(option1, message, arg0, arg1) {
|
|
116015
|
+
createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0, arg1);
|
|
115779
116016
|
}
|
|
115780
116017
|
function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
|
|
115781
116018
|
var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
|
|
@@ -118019,6 +118256,9 @@ var ts;
|
|
|
118019
118256
|
else {
|
|
118020
118257
|
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
118021
118258
|
perDirectoryResolution.set(name, mode, resolution);
|
|
118259
|
+
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
118260
|
+
resolutionHost.onDiscoveredSymlink();
|
|
118261
|
+
}
|
|
118022
118262
|
}
|
|
118023
118263
|
resolutionsInFile.set(name, mode, resolution);
|
|
118024
118264
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
@@ -118487,6 +118727,11 @@ var ts;
|
|
|
118487
118727
|
}
|
|
118488
118728
|
}
|
|
118489
118729
|
ts.createResolutionCache = createResolutionCache;
|
|
118730
|
+
function resolutionIsSymlink(resolution) {
|
|
118731
|
+
var _a, _b;
|
|
118732
|
+
return !!(((_a = resolution.resolvedModule) === null || _a === void 0 ? void 0 : _a.originalPath) ||
|
|
118733
|
+
((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath));
|
|
118734
|
+
}
|
|
118490
118735
|
})(ts || (ts = {}));
|
|
118491
118736
|
// Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.
|
|
118492
118737
|
/* @internal */
|