@typescript-deploys/pr-build 4.6.0-pr-47400-2 → 4.6.0-pr-47552-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.dom.d.ts +144 -58
- package/lib/lib.dom.iterable.d.ts +7 -0
- package/lib/lib.es2015.iterable.d.ts +2 -1
- package/lib/lib.es2020.intl.d.ts +4 -0
- package/lib/lib.es5.d.ts +0 -2
- package/lib/lib.webworker.d.ts +80 -17
- package/lib/lib.webworker.iterable.d.ts +7 -0
- package/lib/protocol.d.ts +1 -0
- package/lib/tsc.js +318 -126
- package/lib/tsserver.js +682 -264
- package/lib/tsserverlibrary.d.ts +12 -6
- package/lib/tsserverlibrary.js +682 -264
- package/lib/typescript.d.ts +11 -6
- package/lib/typescript.js +668 -262
- package/lib/typescriptServices.d.ts +11 -6
- package/lib/typescriptServices.js +668 -262
- package/lib/typingsInstaller.js +379 -145
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220122";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -4171,9 +4171,13 @@ var ts;
|
|
|
4171
4171
|
}
|
|
4172
4172
|
ts.getFileWatcherEventKind = getFileWatcherEventKind;
|
|
4173
4173
|
ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
|
|
4174
|
-
|
|
4174
|
+
var curSysLog = ts.noop;
|
|
4175
|
+
function sysLog(s) {
|
|
4176
|
+
return curSysLog(s);
|
|
4177
|
+
}
|
|
4178
|
+
ts.sysLog = sysLog;
|
|
4175
4179
|
function setSysLog(logger) {
|
|
4176
|
-
|
|
4180
|
+
curSysLog = logger;
|
|
4177
4181
|
}
|
|
4178
4182
|
ts.setSysLog = setSysLog;
|
|
4179
4183
|
function createDirectoryWatcherSupportingRecursive(_a) {
|
|
@@ -4293,7 +4297,7 @@ var ts;
|
|
|
4293
4297
|
}
|
|
4294
4298
|
function onTimerToUpdateChildWatches() {
|
|
4295
4299
|
timerToUpdateChildWatches = undefined;
|
|
4296
|
-
|
|
4300
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
4297
4301
|
var start = ts.timestamp();
|
|
4298
4302
|
var invokeMap = new ts.Map();
|
|
4299
4303
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -4304,7 +4308,7 @@ var ts;
|
|
|
4304
4308
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
4305
4309
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
4306
4310
|
}
|
|
4307
|
-
|
|
4311
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
4308
4312
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
4309
4313
|
var existing = invokeMap.get(rootDirName);
|
|
4310
4314
|
if (existing) {
|
|
@@ -4320,7 +4324,7 @@ var ts;
|
|
|
4320
4324
|
}
|
|
4321
4325
|
});
|
|
4322
4326
|
var elapsed = ts.timestamp() - start;
|
|
4323
|
-
|
|
4327
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
4324
4328
|
}
|
|
4325
4329
|
function removeChildWatches(parentWatcher) {
|
|
4326
4330
|
if (!parentWatcher)
|
|
@@ -4822,7 +4826,7 @@ var ts;
|
|
|
4822
4826
|
}
|
|
4823
4827
|
};
|
|
4824
4828
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
4825
|
-
|
|
4829
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
4826
4830
|
callback("rename", "");
|
|
4827
4831
|
if (watcher) {
|
|
4828
4832
|
watcher.close();
|
|
@@ -4839,7 +4843,7 @@ var ts;
|
|
|
4839
4843
|
}
|
|
4840
4844
|
}
|
|
4841
4845
|
if (hitSystemWatcherLimit) {
|
|
4842
|
-
|
|
4846
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
4843
4847
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4844
4848
|
}
|
|
4845
4849
|
try {
|
|
@@ -4851,7 +4855,7 @@ var ts;
|
|
|
4851
4855
|
}
|
|
4852
4856
|
catch (e) {
|
|
4853
4857
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
4854
|
-
|
|
4858
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
4855
4859
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4856
4860
|
}
|
|
4857
4861
|
}
|
|
@@ -5419,6 +5423,7 @@ var ts;
|
|
|
5419
5423
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5420
5424
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
5421
5425
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
5426
|
+
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5422
5427
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
5423
5428
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
5424
5429
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
@@ -5502,7 +5507,7 @@ var ts;
|
|
|
5502
5507
|
Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, ts.DiagnosticCategory.Error, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."),
|
|
5503
5508
|
Duplicate_index_signature_for_type_0: diag(2374, ts.DiagnosticCategory.Error, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."),
|
|
5504
5509
|
Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
|
|
5505
|
-
|
|
5510
|
+
A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts.DiagnosticCategory.Error, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),
|
|
5506
5511
|
Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, ts.DiagnosticCategory.Error, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."),
|
|
5507
5512
|
A_get_accessor_must_return_a_value: diag(2378, ts.DiagnosticCategory.Error, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."),
|
|
5508
5513
|
Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, ts.DiagnosticCategory.Error, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
|
|
@@ -5525,6 +5530,7 @@ var ts;
|
|
|
5525
5530
|
constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, ts.DiagnosticCategory.Error, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."),
|
|
5526
5531
|
Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, ts.DiagnosticCategory.Error, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),
|
|
5527
5532
|
Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, ts.DiagnosticCategory.Error, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),
|
|
5533
|
+
A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2401, ts.DiagnosticCategory.Error, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),
|
|
5528
5534
|
Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, ts.DiagnosticCategory.Error, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."),
|
|
5529
5535
|
Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, ts.DiagnosticCategory.Error, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),
|
|
5530
5536
|
The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."),
|
|
@@ -5905,6 +5911,7 @@ var ts;
|
|
|
5905
5911
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
|
|
5906
5912
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
|
|
5907
5913
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
5914
|
+
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
5908
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}'."),
|
|
5909
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}'."),
|
|
5910
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}'."),
|
|
@@ -6298,7 +6305,7 @@ var ts;
|
|
|
6298
6305
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
6299
6306
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
6300
6307
|
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
6301
|
-
|
|
6308
|
+
Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
|
|
6302
6309
|
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
6303
6310
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
6304
6311
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
@@ -6674,6 +6681,8 @@ var ts;
|
|
|
6674
6681
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
6675
6682
|
Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
|
|
6676
6683
|
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}'"),
|
|
6684
|
+
Remove_type_from_import_declaration_from_0: diag(90055, ts.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", "Remove 'type' from import declaration from \"{0}\""),
|
|
6685
|
+
Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
|
|
6677
6686
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
6678
6687
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
6679
6688
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -11924,6 +11933,28 @@ var ts;
|
|
|
11924
11933
|
}
|
|
11925
11934
|
}
|
|
11926
11935
|
ts.getThisContainer = getThisContainer;
|
|
11936
|
+
function isThisContainerOrFunctionBlock(node) {
|
|
11937
|
+
switch (node.kind) {
|
|
11938
|
+
case 213:
|
|
11939
|
+
case 255:
|
|
11940
|
+
case 212:
|
|
11941
|
+
case 166:
|
|
11942
|
+
return true;
|
|
11943
|
+
case 234:
|
|
11944
|
+
switch (node.parent.kind) {
|
|
11945
|
+
case 170:
|
|
11946
|
+
case 168:
|
|
11947
|
+
case 171:
|
|
11948
|
+
case 172:
|
|
11949
|
+
return true;
|
|
11950
|
+
default:
|
|
11951
|
+
return false;
|
|
11952
|
+
}
|
|
11953
|
+
default:
|
|
11954
|
+
return false;
|
|
11955
|
+
}
|
|
11956
|
+
}
|
|
11957
|
+
ts.isThisContainerOrFunctionBlock = isThisContainerOrFunctionBlock;
|
|
11927
11958
|
function isInTopLevelContext(node) {
|
|
11928
11959
|
if (ts.isIdentifier(node) && (ts.isClassDeclaration(node.parent) || ts.isFunctionDeclaration(node.parent)) && node.parent.name === node) {
|
|
11929
11960
|
node = node.parent;
|
|
@@ -12254,7 +12285,7 @@ var ts;
|
|
|
12254
12285
|
}
|
|
12255
12286
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
12256
12287
|
function getExternalModuleRequireArgument(node) {
|
|
12257
|
-
return
|
|
12288
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
12258
12289
|
}
|
|
12259
12290
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
12260
12291
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -12308,17 +12339,26 @@ var ts;
|
|
|
12308
12339
|
return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
|
|
12309
12340
|
}
|
|
12310
12341
|
ts.isRequireCall = isRequireCall;
|
|
12311
|
-
function
|
|
12342
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
12343
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, false);
|
|
12344
|
+
}
|
|
12345
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
12346
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
12347
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, true);
|
|
12348
|
+
}
|
|
12349
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
12350
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
12312
12351
|
if (node.kind === 202) {
|
|
12313
12352
|
node = node.parent.parent;
|
|
12314
12353
|
}
|
|
12315
|
-
return ts.isVariableDeclaration(node) &&
|
|
12354
|
+
return ts.isVariableDeclaration(node) &&
|
|
12355
|
+
!!node.initializer &&
|
|
12356
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
|
|
12316
12357
|
}
|
|
12317
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
12318
12358
|
function isRequireVariableStatement(node) {
|
|
12319
12359
|
return ts.isVariableStatement(node)
|
|
12320
12360
|
&& node.declarationList.declarations.length > 0
|
|
12321
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
12361
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
12322
12362
|
}
|
|
12323
12363
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
12324
12364
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -15278,7 +15318,7 @@ var ts;
|
|
|
15278
15318
|
getSourceMapSourceConstructor: function () { return SourceMapSource; },
|
|
15279
15319
|
};
|
|
15280
15320
|
function setObjectAllocator(alloc) {
|
|
15281
|
-
ts.objectAllocator
|
|
15321
|
+
Object.assign(ts.objectAllocator, alloc);
|
|
15282
15322
|
}
|
|
15283
15323
|
ts.setObjectAllocator = setObjectAllocator;
|
|
15284
15324
|
function formatStringFromArgs(text, args, baseIndex) {
|
|
@@ -15286,12 +15326,19 @@ var ts;
|
|
|
15286
15326
|
return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
|
|
15287
15327
|
}
|
|
15288
15328
|
ts.formatStringFromArgs = formatStringFromArgs;
|
|
15329
|
+
var localizedDiagnosticMessages;
|
|
15289
15330
|
function setLocalizedDiagnosticMessages(messages) {
|
|
15290
|
-
|
|
15331
|
+
localizedDiagnosticMessages = messages;
|
|
15291
15332
|
}
|
|
15292
15333
|
ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
|
|
15334
|
+
function maybeSetLocalizedDiagnosticMessages(getMessages) {
|
|
15335
|
+
if (!localizedDiagnosticMessages && getMessages) {
|
|
15336
|
+
localizedDiagnosticMessages = getMessages();
|
|
15337
|
+
}
|
|
15338
|
+
}
|
|
15339
|
+
ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
|
|
15293
15340
|
function getLocaleSpecificMessage(message) {
|
|
15294
|
-
return
|
|
15341
|
+
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
15295
15342
|
}
|
|
15296
15343
|
ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
|
|
15297
15344
|
function createDetachedDiagnostic(fileName, start, length, message) {
|
|
@@ -20925,7 +20972,7 @@ var ts;
|
|
|
20925
20972
|
return getExportName(node, allowComments, allowSourceMaps);
|
|
20926
20973
|
}
|
|
20927
20974
|
function copyPrologue(source, target, ensureUseStrict, visitor) {
|
|
20928
|
-
var offset = copyStandardPrologue(source, target, ensureUseStrict);
|
|
20975
|
+
var offset = copyStandardPrologue(source, target, 0, ensureUseStrict);
|
|
20929
20976
|
return copyCustomPrologue(source, target, offset, visitor);
|
|
20930
20977
|
}
|
|
20931
20978
|
function isUseStrictPrologue(node) {
|
|
@@ -20934,10 +20981,10 @@ var ts;
|
|
|
20934
20981
|
function createUseStrictPrologue() {
|
|
20935
20982
|
return ts.startOnNewLine(createExpressionStatement(createStringLiteral("use strict")));
|
|
20936
20983
|
}
|
|
20937
|
-
function copyStandardPrologue(source, target, ensureUseStrict) {
|
|
20984
|
+
function copyStandardPrologue(source, target, statementOffset, ensureUseStrict) {
|
|
20985
|
+
if (statementOffset === void 0) { statementOffset = 0; }
|
|
20938
20986
|
ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
|
|
20939
20987
|
var foundUseStrict = false;
|
|
20940
|
-
var statementOffset = 0;
|
|
20941
20988
|
var numStatements = source.length;
|
|
20942
20989
|
while (statementOffset < numStatements) {
|
|
20943
20990
|
var statement = source[statementOffset];
|
|
@@ -22087,7 +22134,7 @@ var ts;
|
|
|
22087
22134
|
importName: "__createBinding",
|
|
22088
22135
|
scoped: false,
|
|
22089
22136
|
priority: 1,
|
|
22090
|
-
text: "\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.
|
|
22137
|
+
text: "\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));"
|
|
22091
22138
|
};
|
|
22092
22139
|
ts.setModuleDefaultHelper = {
|
|
22093
22140
|
name: "typescript:commonjscreatevalue",
|
|
@@ -28141,7 +28188,7 @@ var ts;
|
|
|
28141
28188
|
var catchClause = token() === 83 ? parseCatchClause() : undefined;
|
|
28142
28189
|
var finallyBlock;
|
|
28143
28190
|
if (!catchClause || token() === 96) {
|
|
28144
|
-
parseExpected(96);
|
|
28191
|
+
parseExpected(96, ts.Diagnostics.catch_or_finally_expected);
|
|
28145
28192
|
finallyBlock = parseBlock(false);
|
|
28146
28193
|
}
|
|
28147
28194
|
return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
|
|
@@ -29065,7 +29112,7 @@ var ts;
|
|
|
29065
29112
|
var pos = getNodePos();
|
|
29066
29113
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
|
|
29067
29114
|
parseExpected(58);
|
|
29068
|
-
var value =
|
|
29115
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
29069
29116
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
29070
29117
|
}
|
|
29071
29118
|
function parseAssertClause() {
|
|
@@ -33509,7 +33556,7 @@ var ts;
|
|
|
33509
33556
|
? 1 : 0
|
|
33510
33557
|
};
|
|
33511
33558
|
}
|
|
33512
|
-
if (ts.isImplicitGlob(spec)) {
|
|
33559
|
+
if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
|
|
33513
33560
|
return {
|
|
33514
33561
|
key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
|
|
33515
33562
|
flags: 1
|
|
@@ -36553,22 +36600,27 @@ var ts;
|
|
|
36553
36600
|
}
|
|
36554
36601
|
return state;
|
|
36555
36602
|
}
|
|
36556
|
-
function onLeft(left, state,
|
|
36603
|
+
function onLeft(left, state, node) {
|
|
36557
36604
|
if (!state.skip) {
|
|
36558
|
-
|
|
36605
|
+
var maybeBound = maybeBind(left);
|
|
36606
|
+
if (node.operatorToken.kind === 27) {
|
|
36607
|
+
maybeBindExpressionFlowIfCall(left);
|
|
36608
|
+
}
|
|
36609
|
+
return maybeBound;
|
|
36559
36610
|
}
|
|
36560
36611
|
}
|
|
36561
|
-
function onOperator(operatorToken, state,
|
|
36612
|
+
function onOperator(operatorToken, state, _node) {
|
|
36562
36613
|
if (!state.skip) {
|
|
36563
|
-
if (operatorToken.kind === 27) {
|
|
36564
|
-
maybeBindExpressionFlowIfCall(node.left);
|
|
36565
|
-
}
|
|
36566
36614
|
bind(operatorToken);
|
|
36567
36615
|
}
|
|
36568
36616
|
}
|
|
36569
|
-
function onRight(right, state,
|
|
36617
|
+
function onRight(right, state, node) {
|
|
36570
36618
|
if (!state.skip) {
|
|
36571
|
-
|
|
36619
|
+
var maybeBound = maybeBind(right);
|
|
36620
|
+
if (node.operatorToken.kind === 27) {
|
|
36621
|
+
maybeBindExpressionFlowIfCall(right);
|
|
36622
|
+
}
|
|
36623
|
+
return maybeBound;
|
|
36572
36624
|
}
|
|
36573
36625
|
}
|
|
36574
36626
|
function onExit(node, state) {
|
|
@@ -37199,6 +37251,8 @@ var ts;
|
|
|
37199
37251
|
return;
|
|
37200
37252
|
}
|
|
37201
37253
|
ts.setParent(node, parent);
|
|
37254
|
+
if (ts.tracing)
|
|
37255
|
+
node.tracingPath = file.path;
|
|
37202
37256
|
var saveInStrictMode = inStrictMode;
|
|
37203
37257
|
bindWorker(node);
|
|
37204
37258
|
if (node.kind > 159) {
|
|
@@ -37904,7 +37958,7 @@ var ts;
|
|
|
37904
37958
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
37905
37959
|
}
|
|
37906
37960
|
if (!ts.isBindingPattern(node.name)) {
|
|
37907
|
-
if (ts.isInJSFile(node) && ts.
|
|
37961
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
37908
37962
|
declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
|
|
37909
37963
|
}
|
|
37910
37964
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -40182,7 +40236,7 @@ var ts;
|
|
|
40182
40236
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
40183
40237
|
|| node.kind === 295
|
|
40184
40238
|
|| node.kind === 294 && isAliasableOrJsExpression(node.initializer)
|
|
40185
|
-
|| ts.
|
|
40239
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
40186
40240
|
}
|
|
40187
40241
|
function isAliasableOrJsExpression(e) {
|
|
40188
40242
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -40874,8 +40928,13 @@ var ts;
|
|
|
40874
40928
|
var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
40875
40929
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
40876
40930
|
var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
|
|
40877
|
-
var sourceFile = resolvedModule
|
|
40931
|
+
var sourceFile = resolvedModule
|
|
40932
|
+
&& (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
|
|
40933
|
+
&& host.getSourceFile(resolvedModule.resolvedFileName);
|
|
40878
40934
|
if (sourceFile) {
|
|
40935
|
+
if (resolutionDiagnostic) {
|
|
40936
|
+
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
40937
|
+
}
|
|
40879
40938
|
if (sourceFile.symbol) {
|
|
40880
40939
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
40881
40940
|
errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
|
|
@@ -41878,6 +41937,7 @@ var ts;
|
|
|
41878
41937
|
getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
|
|
41879
41938
|
getCurrentDirectory: function () { return host.getCurrentDirectory(); },
|
|
41880
41939
|
getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
|
|
41940
|
+
getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
|
|
41881
41941
|
useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
|
|
41882
41942
|
redirectTargetsMap: host.redirectTargetsMap,
|
|
41883
41943
|
getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
|
|
@@ -56635,10 +56695,21 @@ var ts;
|
|
|
56635
56695
|
}
|
|
56636
56696
|
if (flags & 2097152) {
|
|
56637
56697
|
ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
|
|
56638
|
-
return
|
|
56698
|
+
return getIntersectionTypeFacts(type, ignoreObjects);
|
|
56639
56699
|
}
|
|
56640
56700
|
return 16777215;
|
|
56641
56701
|
}
|
|
56702
|
+
function getIntersectionTypeFacts(type, ignoreObjects) {
|
|
56703
|
+
var oredFacts = 0;
|
|
56704
|
+
var andedFacts = 16777215;
|
|
56705
|
+
for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
|
|
56706
|
+
var t = _a[_i];
|
|
56707
|
+
var f = getTypeFacts(t, ignoreObjects);
|
|
56708
|
+
oredFacts |= f;
|
|
56709
|
+
andedFacts &= f;
|
|
56710
|
+
}
|
|
56711
|
+
return oredFacts & 8288 | andedFacts & 16768927;
|
|
56712
|
+
}
|
|
56642
56713
|
function getTypeWithFacts(type, include) {
|
|
56643
56714
|
return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
|
|
56644
56715
|
}
|
|
@@ -60873,9 +60944,6 @@ var ts;
|
|
|
60873
60944
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
60874
60945
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
60875
60946
|
}
|
|
60876
|
-
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
60877
|
-
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
60878
|
-
}
|
|
60879
60947
|
}
|
|
60880
60948
|
else {
|
|
60881
60949
|
if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 && isUncalledFunctionReference(node, prop)) {
|
|
@@ -65231,7 +65299,7 @@ var ts;
|
|
|
65231
65299
|
}
|
|
65232
65300
|
}
|
|
65233
65301
|
function checkExpression(node, checkMode, forceTuple) {
|
|
65234
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
|
|
65302
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
65235
65303
|
var saveCurrentNode = currentNode;
|
|
65236
65304
|
currentNode = node;
|
|
65237
65305
|
instantiationCount = 0;
|
|
@@ -65811,25 +65879,29 @@ var ts;
|
|
|
65811
65879
|
if (classExtendsNull) {
|
|
65812
65880
|
error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
65813
65881
|
}
|
|
65814
|
-
var
|
|
65882
|
+
var superCallShouldBeRootLevel = (ts.getEmitScriptTarget(compilerOptions) !== 99 || !useDefineForClassFields) &&
|
|
65815
65883
|
(ts.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) ||
|
|
65816
65884
|
ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 16476); }));
|
|
65817
|
-
if (
|
|
65818
|
-
|
|
65819
|
-
|
|
65820
|
-
|
|
65821
|
-
|
|
65822
|
-
|
|
65823
|
-
|
|
65824
|
-
|
|
65885
|
+
if (superCallShouldBeRootLevel) {
|
|
65886
|
+
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
65887
|
+
error(superCall, ts.Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
65888
|
+
}
|
|
65889
|
+
else {
|
|
65890
|
+
var superCallStatement = void 0;
|
|
65891
|
+
for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) {
|
|
65892
|
+
var statement = _a[_i];
|
|
65893
|
+
if (ts.isExpressionStatement(statement) && ts.isSuperCall(ts.skipOuterExpressions(statement.expression))) {
|
|
65894
|
+
superCallStatement = statement;
|
|
65895
|
+
break;
|
|
65896
|
+
}
|
|
65897
|
+
if (!ts.isPrologueDirective(statement) && nodeImmediatelyReferencesSuperOrThis(statement)) {
|
|
65898
|
+
break;
|
|
65899
|
+
}
|
|
65825
65900
|
}
|
|
65826
|
-
if (
|
|
65827
|
-
|
|
65901
|
+
if (superCallStatement === undefined) {
|
|
65902
|
+
error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
65828
65903
|
}
|
|
65829
65904
|
}
|
|
65830
|
-
if (!superCallStatement) {
|
|
65831
|
-
error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
65832
|
-
}
|
|
65833
65905
|
}
|
|
65834
65906
|
}
|
|
65835
65907
|
else if (!classExtendsNull) {
|
|
@@ -65837,6 +65909,19 @@ var ts;
|
|
|
65837
65909
|
}
|
|
65838
65910
|
}
|
|
65839
65911
|
}
|
|
65912
|
+
function superCallIsRootLevelInConstructor(superCall, body) {
|
|
65913
|
+
var superCallParent = ts.walkUpParenthesizedExpressions(superCall.parent);
|
|
65914
|
+
return ts.isExpressionStatement(superCallParent) && superCallParent.parent === body;
|
|
65915
|
+
}
|
|
65916
|
+
function nodeImmediatelyReferencesSuperOrThis(node) {
|
|
65917
|
+
if (node.kind === 106 || node.kind === 108) {
|
|
65918
|
+
return true;
|
|
65919
|
+
}
|
|
65920
|
+
if (ts.isThisContainerOrFunctionBlock(node)) {
|
|
65921
|
+
return false;
|
|
65922
|
+
}
|
|
65923
|
+
return !!ts.forEachChild(node, nodeImmediatelyReferencesSuperOrThis);
|
|
65924
|
+
}
|
|
65840
65925
|
function checkAccessorDeclaration(node) {
|
|
65841
65926
|
if (produceDiagnostics) {
|
|
65842
65927
|
if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node))
|
|
@@ -67471,7 +67556,7 @@ var ts;
|
|
|
67471
67556
|
return;
|
|
67472
67557
|
}
|
|
67473
67558
|
var symbol = getSymbolOfNode(node);
|
|
67474
|
-
if (symbol.flags & 2097152 && ts.
|
|
67559
|
+
if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
67475
67560
|
checkAliasSymbol(node);
|
|
67476
67561
|
return;
|
|
67477
67562
|
}
|
|
@@ -67543,7 +67628,7 @@ var ts;
|
|
|
67543
67628
|
return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
|
|
67544
67629
|
}
|
|
67545
67630
|
function checkVariableDeclaration(node) {
|
|
67546
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
|
|
67631
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
67547
67632
|
checkGrammarVariableDeclaration(node);
|
|
67548
67633
|
checkVariableLikeDeclaration(node);
|
|
67549
67634
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -69532,6 +69617,17 @@ var ts;
|
|
|
69532
69617
|
return false;
|
|
69533
69618
|
}
|
|
69534
69619
|
}
|
|
69620
|
+
if (!ts.isImportEqualsDeclaration(node) && node.assertClause) {
|
|
69621
|
+
var hasError = false;
|
|
69622
|
+
for (var _i = 0, _a = node.assertClause.elements; _i < _a.length; _i++) {
|
|
69623
|
+
var clause = _a[_i];
|
|
69624
|
+
if (!ts.isStringLiteral(clause.value)) {
|
|
69625
|
+
hasError = true;
|
|
69626
|
+
error(clause.value, ts.Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
|
|
69627
|
+
}
|
|
69628
|
+
}
|
|
69629
|
+
return !hasError;
|
|
69630
|
+
}
|
|
69535
69631
|
return true;
|
|
69536
69632
|
}
|
|
69537
69633
|
function checkAliasSymbol(node) {
|
|
@@ -70167,7 +70263,7 @@ var ts;
|
|
|
70167
70263
|
}
|
|
70168
70264
|
}
|
|
70169
70265
|
function checkDeferredNode(node) {
|
|
70170
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
|
|
70266
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
|
|
70171
70267
|
var saveCurrentNode = currentNode;
|
|
70172
70268
|
currentNode = node;
|
|
70173
70269
|
instantiationCount = 0;
|
|
@@ -73747,7 +73843,7 @@ var ts;
|
|
|
73747
73843
|
return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
|
|
73748
73844
|
case 293:
|
|
73749
73845
|
ts.Debug.type(node);
|
|
73750
|
-
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.
|
|
73846
|
+
return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isExpressionNode));
|
|
73751
73847
|
case 266:
|
|
73752
73848
|
ts.Debug.type(node);
|
|
73753
73849
|
return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
|
|
@@ -74700,25 +74796,26 @@ var ts;
|
|
|
74700
74796
|
}
|
|
74701
74797
|
}
|
|
74702
74798
|
ts.getNonAssignmentOperatorForCompoundAssignment = getNonAssignmentOperatorForCompoundAssignment;
|
|
74703
|
-
function
|
|
74704
|
-
if (
|
|
74705
|
-
|
|
74706
|
-
|
|
74707
|
-
|
|
74708
|
-
|
|
74709
|
-
|
|
74710
|
-
|
|
74711
|
-
|
|
74712
|
-
|
|
74713
|
-
|
|
74714
|
-
|
|
74715
|
-
|
|
74799
|
+
function getSuperCallFromStatement(statement) {
|
|
74800
|
+
if (!ts.isExpressionStatement(statement)) {
|
|
74801
|
+
return undefined;
|
|
74802
|
+
}
|
|
74803
|
+
var expression = ts.skipParentheses(statement.expression);
|
|
74804
|
+
return ts.isSuperCall(expression)
|
|
74805
|
+
? expression
|
|
74806
|
+
: undefined;
|
|
74807
|
+
}
|
|
74808
|
+
ts.getSuperCallFromStatement = getSuperCallFromStatement;
|
|
74809
|
+
function findSuperStatementIndex(statements, indexAfterLastPrologueStatement) {
|
|
74810
|
+
for (var i = indexAfterLastPrologueStatement; i < statements.length; i += 1) {
|
|
74811
|
+
var statement = statements[i];
|
|
74812
|
+
if (getSuperCallFromStatement(statement)) {
|
|
74813
|
+
return i;
|
|
74716
74814
|
}
|
|
74717
|
-
return index;
|
|
74718
74815
|
}
|
|
74719
|
-
return
|
|
74816
|
+
return -1;
|
|
74720
74817
|
}
|
|
74721
|
-
ts.
|
|
74818
|
+
ts.findSuperStatementIndex = findSuperStatementIndex;
|
|
74722
74819
|
function getProperties(node, requireInitializer, isStatic) {
|
|
74723
74820
|
return ts.filter(node.members, function (m) { return isInitializedOrStaticProperty(m, requireInitializer, isStatic); });
|
|
74724
74821
|
}
|
|
@@ -75921,6 +76018,7 @@ var ts;
|
|
|
75921
76018
|
case 176:
|
|
75922
76019
|
case 133:
|
|
75923
76020
|
return factory.createIdentifier("Boolean");
|
|
76021
|
+
case 197:
|
|
75924
76022
|
case 149:
|
|
75925
76023
|
return factory.createIdentifier("String");
|
|
75926
76024
|
case 147:
|
|
@@ -76158,11 +76256,20 @@ var ts;
|
|
|
76158
76256
|
return ts.visitFunctionBody(body, visitor, context);
|
|
76159
76257
|
}
|
|
76160
76258
|
var statements = [];
|
|
76161
|
-
var indexOfFirstStatement = 0;
|
|
76162
76259
|
resumeLexicalEnvironment();
|
|
76163
|
-
|
|
76164
|
-
ts.
|
|
76165
|
-
|
|
76260
|
+
var indexAfterLastPrologueStatement = factory.copyPrologue(body.statements, statements, false, visitor);
|
|
76261
|
+
var superStatementIndex = ts.findSuperStatementIndex(body.statements, indexAfterLastPrologueStatement);
|
|
76262
|
+
if (superStatementIndex >= 0) {
|
|
76263
|
+
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, indexAfterLastPrologueStatement, superStatementIndex + 1 - indexAfterLastPrologueStatement));
|
|
76264
|
+
}
|
|
76265
|
+
var parameterPropertyAssignments = ts.mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment);
|
|
76266
|
+
if (superStatementIndex >= 0) {
|
|
76267
|
+
ts.addRange(statements, parameterPropertyAssignments);
|
|
76268
|
+
}
|
|
76269
|
+
else {
|
|
76270
|
+
statements = ts.addRange(parameterPropertyAssignments, statements);
|
|
76271
|
+
}
|
|
76272
|
+
ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, superStatementIndex + 1));
|
|
76166
76273
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
76167
76274
|
var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), body.statements), true);
|
|
76168
76275
|
ts.setTextRange(block, body);
|
|
@@ -77544,6 +77651,7 @@ var ts;
|
|
|
77544
77651
|
return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(factory.createConstructorDeclaration(undefined, undefined, parameters !== null && parameters !== void 0 ? parameters : [], body), constructor || node), constructor));
|
|
77545
77652
|
}
|
|
77546
77653
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
|
77654
|
+
var _a;
|
|
77547
77655
|
var properties = ts.getProperties(node, false, false);
|
|
77548
77656
|
if (!useDefineForClassFields) {
|
|
77549
77657
|
properties = ts.filter(properties, function (property) { return !!property.initializer || ts.isPrivateIdentifier(property.name); });
|
|
@@ -77554,34 +77662,65 @@ var ts;
|
|
|
77554
77662
|
return ts.visitFunctionBody(undefined, visitor, context);
|
|
77555
77663
|
}
|
|
77556
77664
|
resumeLexicalEnvironment();
|
|
77557
|
-
var
|
|
77665
|
+
var needsSyntheticConstructor = !constructor && isDerivedClass;
|
|
77666
|
+
var indexOfFirstStatementAfterSuper = 0;
|
|
77667
|
+
var prologueStatementCount = 0;
|
|
77668
|
+
var superStatementIndex = -1;
|
|
77558
77669
|
var statements = [];
|
|
77559
|
-
if (
|
|
77560
|
-
|
|
77670
|
+
if ((_a = constructor === null || constructor === void 0 ? void 0 : constructor.body) === null || _a === void 0 ? void 0 : _a.statements) {
|
|
77671
|
+
prologueStatementCount = factory.copyPrologue(constructor.body.statements, statements, false, visitor);
|
|
77672
|
+
superStatementIndex = ts.findSuperStatementIndex(constructor.body.statements, prologueStatementCount);
|
|
77673
|
+
if (superStatementIndex >= 0) {
|
|
77674
|
+
indexOfFirstStatementAfterSuper = superStatementIndex + 1;
|
|
77675
|
+
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuper - prologueStatementCount), true), statements.slice(prologueStatementCount), true);
|
|
77676
|
+
}
|
|
77561
77677
|
}
|
|
77562
|
-
if (
|
|
77563
|
-
|
|
77678
|
+
if (needsSyntheticConstructor) {
|
|
77679
|
+
statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createSuper(), undefined, [factory.createSpreadElement(factory.createIdentifier("arguments"))])));
|
|
77564
77680
|
}
|
|
77681
|
+
var parameterPropertyDeclarationCount = 0;
|
|
77565
77682
|
if (constructor === null || constructor === void 0 ? void 0 : constructor.body) {
|
|
77566
|
-
|
|
77567
|
-
|
|
77568
|
-
afterParameterProperties = constructor.body.statements.length;
|
|
77683
|
+
if (useDefineForClassFields) {
|
|
77684
|
+
statements = statements.filter(function (statement) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor); });
|
|
77569
77685
|
}
|
|
77570
|
-
|
|
77571
|
-
|
|
77572
|
-
|
|
77686
|
+
else {
|
|
77687
|
+
for (var _i = 0, _b = constructor.body.statements; _i < _b.length; _i++) {
|
|
77688
|
+
var statement = _b[_i];
|
|
77689
|
+
if (ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor)) {
|
|
77690
|
+
parameterPropertyDeclarationCount++;
|
|
77691
|
+
}
|
|
77692
|
+
}
|
|
77693
|
+
if (parameterPropertyDeclarationCount > 0) {
|
|
77694
|
+
var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatementAfterSuper, parameterPropertyDeclarationCount);
|
|
77695
|
+
if (superStatementIndex >= 0) {
|
|
77696
|
+
ts.addRange(statements, parameterProperties);
|
|
77697
|
+
}
|
|
77698
|
+
else if (needsSyntheticConstructor) {
|
|
77699
|
+
statements = __spreadArray(__spreadArray([
|
|
77700
|
+
statements[0]
|
|
77701
|
+
], parameterProperties, true), statements.slice(1), true);
|
|
77702
|
+
}
|
|
77703
|
+
else {
|
|
77704
|
+
statements = __spreadArray(__spreadArray([], parameterProperties, true), statements, true);
|
|
77705
|
+
}
|
|
77706
|
+
indexOfFirstStatementAfterSuper += parameterPropertyDeclarationCount;
|
|
77573
77707
|
}
|
|
77574
|
-
indexOfFirstStatement = afterParameterProperties;
|
|
77575
77708
|
}
|
|
77576
77709
|
}
|
|
77577
77710
|
var receiver = factory.createThis();
|
|
77578
77711
|
addMethodStatements(statements, privateMethodsAndAccessors, receiver);
|
|
77579
77712
|
addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
|
|
77580
77713
|
if (constructor) {
|
|
77581
|
-
ts.addRange(statements, ts.visitNodes(constructor.body.statements,
|
|
77714
|
+
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement, indexOfFirstStatementAfterSuper + prologueStatementCount));
|
|
77582
77715
|
}
|
|
77583
77716
|
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
|
77584
77717
|
return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined);
|
|
77718
|
+
function visitBodyStatement(statement) {
|
|
77719
|
+
if (useDefineForClassFields && ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor)) {
|
|
77720
|
+
return undefined;
|
|
77721
|
+
}
|
|
77722
|
+
return visitor(statement);
|
|
77723
|
+
}
|
|
77585
77724
|
}
|
|
77586
77725
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
77587
77726
|
for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
|
|
@@ -79704,10 +79843,16 @@ var ts;
|
|
|
79704
79843
|
var _a;
|
|
79705
79844
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
79706
79845
|
var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
|
|
79707
|
-
var args = [tagName, objectProperties
|
|
79846
|
+
var args = [tagName, objectProperties];
|
|
79847
|
+
if (keyAttr) {
|
|
79848
|
+
args.push(transformJsxAttributeInitializer(keyAttr.initializer));
|
|
79849
|
+
}
|
|
79708
79850
|
if (compilerOptions.jsx === 5) {
|
|
79709
79851
|
var originalFile = ts.getOriginalNode(currentSourceFile);
|
|
79710
79852
|
if (originalFile && ts.isSourceFile(originalFile)) {
|
|
79853
|
+
if (keyAttr === undefined) {
|
|
79854
|
+
args.push(factory.createVoidZero());
|
|
79855
|
+
}
|
|
79711
79856
|
args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
|
|
79712
79857
|
var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
|
|
79713
79858
|
args.push(factory.createObjectLiteralExpression([
|
|
@@ -80642,40 +80787,47 @@ var ts;
|
|
|
80642
80787
|
var prologue = [];
|
|
80643
80788
|
var statements = [];
|
|
80644
80789
|
resumeLexicalEnvironment();
|
|
80645
|
-
var
|
|
80790
|
+
var existingPrologue = ts.takeWhile(constructor.body.statements, ts.isPrologueDirective);
|
|
80791
|
+
var _a = findSuperCallAndStatementIndex(constructor.body.statements, existingPrologue), superCall = _a.superCall, superStatementIndex = _a.superStatementIndex;
|
|
80792
|
+
var postSuperStatementsStart = superStatementIndex === -1 ? existingPrologue.length : superStatementIndex + 1;
|
|
80793
|
+
var statementOffset = postSuperStatementsStart;
|
|
80646
80794
|
if (!hasSynthesizedSuper)
|
|
80647
|
-
statementOffset = factory.copyStandardPrologue(constructor.body.statements, prologue, false);
|
|
80648
|
-
addDefaultValueAssignmentsIfNeeded(statements, constructor);
|
|
80649
|
-
addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);
|
|
80795
|
+
statementOffset = factory.copyStandardPrologue(constructor.body.statements, prologue, statementOffset, false);
|
|
80650
80796
|
if (!hasSynthesizedSuper)
|
|
80651
|
-
statementOffset = factory.copyCustomPrologue(constructor.body.statements, statements, statementOffset, visitor);
|
|
80797
|
+
statementOffset = factory.copyCustomPrologue(constructor.body.statements, statements, statementOffset, visitor, undefined);
|
|
80652
80798
|
var superCallExpression;
|
|
80653
80799
|
if (hasSynthesizedSuper) {
|
|
80654
80800
|
superCallExpression = createDefaultSuperCallOrThis();
|
|
80655
80801
|
}
|
|
80656
|
-
else if (
|
|
80657
|
-
|
|
80658
|
-
if (ts.isExpressionStatement(firstStatement) && ts.isSuperCall(firstStatement.expression)) {
|
|
80659
|
-
superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);
|
|
80660
|
-
}
|
|
80802
|
+
else if (superCall) {
|
|
80803
|
+
superCallExpression = visitSuperCallInBody(superCall);
|
|
80661
80804
|
}
|
|
80662
80805
|
if (superCallExpression) {
|
|
80663
80806
|
hierarchyFacts |= 8192;
|
|
80664
|
-
statementOffset++;
|
|
80665
80807
|
}
|
|
80808
|
+
addDefaultValueAssignmentsIfNeeded(prologue, constructor);
|
|
80809
|
+
addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper);
|
|
80666
80810
|
ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset));
|
|
80667
80811
|
factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());
|
|
80668
80812
|
insertCaptureNewTargetIfNeeded(prologue, constructor, false);
|
|
80669
|
-
if (isDerivedClass) {
|
|
80670
|
-
if (superCallExpression &&
|
|
80671
|
-
var
|
|
80813
|
+
if (isDerivedClass || superCallExpression) {
|
|
80814
|
+
if (superCallExpression && postSuperStatementsStart === constructor.body.statements.length && !(constructor.body.transformFlags & 8192)) {
|
|
80815
|
+
var superCall_1 = ts.cast(ts.cast(superCallExpression, ts.isBinaryExpression).left, ts.isCallExpression);
|
|
80672
80816
|
var returnStatement = factory.createReturnStatement(superCallExpression);
|
|
80673
|
-
ts.setCommentRange(returnStatement, ts.getCommentRange(
|
|
80674
|
-
ts.setEmitFlags(
|
|
80817
|
+
ts.setCommentRange(returnStatement, ts.getCommentRange(superCall_1));
|
|
80818
|
+
ts.setEmitFlags(superCall_1, 1536);
|
|
80675
80819
|
statements.push(returnStatement);
|
|
80676
80820
|
}
|
|
80677
80821
|
else {
|
|
80678
|
-
|
|
80822
|
+
if (superStatementIndex <= existingPrologue.length) {
|
|
80823
|
+
insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis());
|
|
80824
|
+
}
|
|
80825
|
+
else {
|
|
80826
|
+
insertCaptureThisForNode(prologue, constructor, createActualThis());
|
|
80827
|
+
if (superCallExpression) {
|
|
80828
|
+
insertSuperThisCaptureThisForNode(statements, superCallExpression);
|
|
80829
|
+
}
|
|
80830
|
+
}
|
|
80679
80831
|
if (!isSufficientlyCoveredByReturnStatements(constructor.body)) {
|
|
80680
80832
|
statements.push(factory.createReturnStatement(factory.createUniqueName("_this", 16 | 32)));
|
|
80681
80833
|
}
|
|
@@ -80684,9 +80836,23 @@ var ts;
|
|
|
80684
80836
|
else {
|
|
80685
80837
|
insertCaptureThisForNodeIfNeeded(prologue, constructor);
|
|
80686
80838
|
}
|
|
80687
|
-
var
|
|
80688
|
-
ts.setTextRange(
|
|
80689
|
-
return
|
|
80839
|
+
var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex)), true), statements, true)), constructor.body.statements), true);
|
|
80840
|
+
ts.setTextRange(body, constructor.body);
|
|
80841
|
+
return body;
|
|
80842
|
+
}
|
|
80843
|
+
function findSuperCallAndStatementIndex(originalBodyStatements, existingPrologue) {
|
|
80844
|
+
for (var i = existingPrologue.length; i < originalBodyStatements.length; i += 1) {
|
|
80845
|
+
var superCall = ts.getSuperCallFromStatement(originalBodyStatements[i]);
|
|
80846
|
+
if (superCall) {
|
|
80847
|
+
return {
|
|
80848
|
+
superCall: superCall,
|
|
80849
|
+
superStatementIndex: i,
|
|
80850
|
+
};
|
|
80851
|
+
}
|
|
80852
|
+
}
|
|
80853
|
+
return {
|
|
80854
|
+
superStatementIndex: -1,
|
|
80855
|
+
};
|
|
80690
80856
|
}
|
|
80691
80857
|
function isSufficientlyCoveredByReturnStatements(statement) {
|
|
80692
80858
|
if (statement.kind === 246) {
|
|
@@ -80813,6 +80979,12 @@ var ts;
|
|
|
80813
80979
|
}
|
|
80814
80980
|
return false;
|
|
80815
80981
|
}
|
|
80982
|
+
function insertSuperThisCaptureThisForNode(statements, superExpression) {
|
|
80983
|
+
enableSubstitutionsForCapturedThis();
|
|
80984
|
+
var assignSuperExpression = factory.createExpressionStatement(factory.createBinaryExpression(factory.createThis(), 63, superExpression));
|
|
80985
|
+
ts.insertStatementAfterCustomPrologue(statements, assignSuperExpression);
|
|
80986
|
+
ts.setCommentRange(assignSuperExpression, ts.getOriginalNode(superExpression).parent);
|
|
80987
|
+
}
|
|
80816
80988
|
function insertCaptureThisForNode(statements, node, initializer) {
|
|
80817
80989
|
enableSubstitutionsForCapturedThis();
|
|
80818
80990
|
var captureThisStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
@@ -81022,7 +81194,7 @@ var ts;
|
|
|
81022
81194
|
var statementOffset;
|
|
81023
81195
|
resumeLexicalEnvironment();
|
|
81024
81196
|
if (ts.isBlock(body)) {
|
|
81025
|
-
statementOffset = factory.copyStandardPrologue(body.statements, prologue, false);
|
|
81197
|
+
statementOffset = factory.copyStandardPrologue(body.statements, prologue, 0, false);
|
|
81026
81198
|
statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedFunction);
|
|
81027
81199
|
statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedVariableStatement);
|
|
81028
81200
|
}
|
|
@@ -81939,7 +82111,7 @@ var ts;
|
|
|
81939
82111
|
ts.addRange(statements, classStatements, 1);
|
|
81940
82112
|
return factory.restoreOuterExpressions(node.expression, factory.restoreOuterExpressions(variable.initializer, factory.restoreOuterExpressions(aliasAssignment && aliasAssignment.right, factory.updateCallExpression(call, factory.restoreOuterExpressions(call.expression, factory.updateFunctionExpression(func, undefined, undefined, undefined, undefined, func.parameters, undefined, factory.updateBlock(func.body, statements))), undefined, call.arguments))));
|
|
81941
82113
|
}
|
|
81942
|
-
function
|
|
82114
|
+
function visitSuperCallInBody(node) {
|
|
81943
82115
|
return visitCallExpressionWithPotentialCapturedThisAssignment(node, false);
|
|
81944
82116
|
}
|
|
81945
82117
|
function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
|
|
@@ -98527,11 +98699,12 @@ var ts;
|
|
|
98527
98699
|
};
|
|
98528
98700
|
}
|
|
98529
98701
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
98702
|
+
var _a;
|
|
98530
98703
|
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
|
|
98531
98704
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
98532
98705
|
return false;
|
|
98533
98706
|
}
|
|
98534
|
-
return ts.getImpliedNodeFormatForFile(importingSourceFileName,
|
|
98707
|
+
return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
|
|
98535
98708
|
}
|
|
98536
98709
|
function getModuleResolutionHost(host) {
|
|
98537
98710
|
var _a;
|
|
@@ -99004,11 +99177,13 @@ var ts;
|
|
|
99004
99177
|
var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
|
|
99005
99178
|
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
|
|
99006
99179
|
function tryDirectoryWithPackageJson(packageRootIndex) {
|
|
99180
|
+
var _a, _b;
|
|
99007
99181
|
var packageRootPath = path.substring(0, packageRootIndex);
|
|
99008
99182
|
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
|
|
99009
99183
|
var moduleFileToTry = path;
|
|
99010
|
-
|
|
99011
|
-
|
|
99184
|
+
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
99185
|
+
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
99186
|
+
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
99012
99187
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
99013
99188
|
var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
99014
99189
|
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
@@ -99275,22 +99450,31 @@ var ts;
|
|
|
99275
99450
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99276
99451
|
}
|
|
99277
99452
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99453
|
+
function prettyPathForFileError(error, cwd) {
|
|
99454
|
+
var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
|
|
99455
|
+
if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
|
|
99456
|
+
return ts.getRelativePathFromDirectory(cwd, error.fileName, false) + line;
|
|
99457
|
+
}
|
|
99458
|
+
return error.fileName + line;
|
|
99459
|
+
}
|
|
99278
99460
|
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
99279
99461
|
if (errorCount === 0)
|
|
99280
99462
|
return "";
|
|
99281
99463
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99282
99464
|
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99283
99465
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99466
|
+
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
99284
99467
|
var d = errorCount === 1 ?
|
|
99285
99468
|
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
99286
99469
|
ts.Diagnostics.Found_1_error_in_1 :
|
|
99287
|
-
ts.Diagnostics.Found_1_error, errorCount,
|
|
99470
|
+
ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
|
|
99288
99471
|
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
99289
99472
|
ts.Diagnostics.Found_0_errors :
|
|
99290
99473
|
distinctFileNamesWithLines.length === 1 ?
|
|
99291
|
-
ts.Diagnostics.
|
|
99292
|
-
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99293
|
-
|
|
99474
|
+
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
99475
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
99476
|
+
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
99477
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
99294
99478
|
}
|
|
99295
99479
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99296
99480
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -99312,8 +99496,8 @@ var ts;
|
|
|
99312
99496
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99313
99497
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99314
99498
|
: "";
|
|
99315
|
-
var
|
|
99316
|
-
tabularData += "" + leftPadding + errorCount + " " +
|
|
99499
|
+
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
99500
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
99317
99501
|
});
|
|
99318
99502
|
return tabularData;
|
|
99319
99503
|
}
|
|
@@ -99778,6 +99962,7 @@ var ts;
|
|
|
99778
99962
|
var sharedExtendedConfigFileWatchers;
|
|
99779
99963
|
var extendedConfigCache = host.extendedConfigCache;
|
|
99780
99964
|
var changesAffectResolution = false;
|
|
99965
|
+
var reportFileChangeDetectedOnCreateProgram = false;
|
|
99781
99966
|
var sourceFilesCache = new ts.Map();
|
|
99782
99967
|
var missingFilePathsRequestedForRelease;
|
|
99783
99968
|
var hasChangedCompilerOptions = false;
|
|
@@ -99931,14 +100116,21 @@ var ts;
|
|
|
99931
100116
|
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
|
|
99932
100117
|
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
99933
100118
|
if (hasChangedConfigFileParsingErrors) {
|
|
100119
|
+
if (reportFileChangeDetectedOnCreateProgram) {
|
|
100120
|
+
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
100121
|
+
}
|
|
99934
100122
|
builderProgram = createProgram(undefined, undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
99935
100123
|
hasChangedConfigFileParsingErrors = false;
|
|
99936
100124
|
}
|
|
99937
100125
|
}
|
|
99938
100126
|
else {
|
|
100127
|
+
if (reportFileChangeDetectedOnCreateProgram) {
|
|
100128
|
+
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
100129
|
+
}
|
|
99939
100130
|
createNewProgram(hasInvalidatedResolution);
|
|
99940
100131
|
}
|
|
99941
100132
|
changesAffectResolution = false;
|
|
100133
|
+
reportFileChangeDetectedOnCreateProgram = false;
|
|
99942
100134
|
if (host.afterProgramCreate && program !== builderProgram) {
|
|
99943
100135
|
host.afterProgramCreate(builderProgram);
|
|
99944
100136
|
}
|
|
@@ -100117,7 +100309,7 @@ var ts;
|
|
|
100117
100309
|
}
|
|
100118
100310
|
function updateProgramWithWatchStatus() {
|
|
100119
100311
|
timerToUpdateProgram = undefined;
|
|
100120
|
-
|
|
100312
|
+
reportFileChangeDetectedOnCreateProgram = true;
|
|
100121
100313
|
updateProgram();
|
|
100122
100314
|
}
|
|
100123
100315
|
function updateProgram() {
|