@typescript-deploys/pr-build 5.5.0-pr-58243-73 → 5.5.0-pr-58610-9
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.es2015.iterable.d.ts +67 -69
- package/lib/lib.es2018.asynciterable.d.ts +5 -5
- package/lib/lib.es2020.bigint.d.ts +8 -8
- package/lib/lib.es2020.string.d.ts +1 -1
- package/lib/lib.es2020.symbol.wellknown.d.ts +1 -1
- package/lib/lib.es2022.intl.d.ts +1 -1
- package/lib/tsc.js +226 -173
- package/lib/typescript.d.ts +1 -3
- package/lib/typescript.js +307 -224
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240522`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3561,6 +3561,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3561
3561
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
3562
3562
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
3563
3563
|
TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1";
|
|
3564
|
+
TypeFlags2[TypeFlags2["Reserved2"] = 1073741824] = "Reserved2";
|
|
3564
3565
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
3565
3566
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
3566
3567
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -3599,6 +3600,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3599
3600
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
3600
3601
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
3601
3602
|
TypeFlags2[TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 /* Reserved1 */] = "IncludesConstrainedTypeVariable";
|
|
3603
|
+
TypeFlags2[TypeFlags2["IncludesError"] = 1073741824 /* Reserved2 */] = "IncludesError";
|
|
3602
3604
|
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
3603
3605
|
return TypeFlags2;
|
|
3604
3606
|
})(TypeFlags || {});
|
|
@@ -7336,7 +7338,6 @@ var Diagnostics = {
|
|
|
7336
7338
|
Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
|
|
7337
7339
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
7338
7340
|
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
|
|
7339
|
-
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
|
|
7340
7341
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
7341
7342
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
|
7342
7343
|
Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
|
|
@@ -7509,6 +7510,7 @@ var Diagnostics = {
|
|
|
7509
7510
|
Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit: diag(9035, 1 /* Error */, "Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035", "Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."),
|
|
7510
7511
|
Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it: diag(9036, 1 /* Error */, "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036", "Move the expression in default export to a variable and add a type annotation to it."),
|
|
7511
7512
|
Default_exports_can_t_be_inferred_with_isolatedDeclarations: diag(9037, 1 /* Error */, "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037", "Default exports can't be inferred with --isolatedDeclarations."),
|
|
7513
|
+
Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations: diag(9038, 1 /* Error */, "Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations_9038", "Computed property names on class or object literals cannot be inferred with --isolatedDeclarations."),
|
|
7512
7514
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
7513
7515
|
JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, 1 /* Error */, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."),
|
|
7514
7516
|
Expected_corresponding_JSX_closing_tag_for_0: diag(17002, 1 /* Error */, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."),
|
|
@@ -11522,7 +11524,7 @@ function getTextOfJSDocComment(comment) {
|
|
|
11522
11524
|
function formatJSDocLink(link) {
|
|
11523
11525
|
const kind = link.kind === 324 /* JSDocLink */ ? "link" : link.kind === 325 /* JSDocLinkCode */ ? "linkcode" : "linkplain";
|
|
11524
11526
|
const name = link.name ? entityNameToString(link.name) : "";
|
|
11525
|
-
const space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
11527
|
+
const space = link.name && (link.text === "" || link.text.startsWith("://")) ? "" : " ";
|
|
11526
11528
|
return `{@${kind} ${name}${space}${link.text}}`;
|
|
11527
11529
|
}
|
|
11528
11530
|
function getEffectiveTypeParameterDeclarations(node) {
|
|
@@ -16878,6 +16880,9 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
16878
16880
|
}
|
|
16879
16881
|
return 0;
|
|
16880
16882
|
}
|
|
16883
|
+
function skipAlias(symbol, checker) {
|
|
16884
|
+
return symbol.flags & 2097152 /* Alias */ ? checker.getAliasedSymbol(symbol) : symbol;
|
|
16885
|
+
}
|
|
16881
16886
|
function getCombinedLocalAndExportSymbolFlags(symbol) {
|
|
16882
16887
|
return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags;
|
|
16883
16888
|
}
|
|
@@ -17607,12 +17612,6 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
17607
17612
|
return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
17608
17613
|
}
|
|
17609
17614
|
},
|
|
17610
|
-
strictBuiltinIteratorReturn: {
|
|
17611
|
-
dependencies: ["strict"],
|
|
17612
|
-
computeValue: (compilerOptions) => {
|
|
17613
|
-
return getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn");
|
|
17614
|
-
}
|
|
17615
|
-
},
|
|
17616
17615
|
alwaysStrict: {
|
|
17617
17616
|
dependencies: ["strict"],
|
|
17618
17617
|
computeValue: (compilerOptions) => {
|
|
@@ -36006,16 +36005,6 @@ var commandOptionsWithoutBuild = [
|
|
|
36006
36005
|
description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
36007
36006
|
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
36008
36007
|
},
|
|
36009
|
-
{
|
|
36010
|
-
name: "strictBuiltinIteratorReturn",
|
|
36011
|
-
type: "boolean",
|
|
36012
|
-
affectsSemanticDiagnostics: true,
|
|
36013
|
-
affectsBuildInfo: true,
|
|
36014
|
-
strictFlag: true,
|
|
36015
|
-
category: Diagnostics.Type_Checking,
|
|
36016
|
-
description: Diagnostics.Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any,
|
|
36017
|
-
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
36018
|
-
},
|
|
36019
36008
|
{
|
|
36020
36009
|
name: "noImplicitThis",
|
|
36021
36010
|
type: "boolean",
|
|
@@ -44102,7 +44091,7 @@ function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile
|
|
|
44102
44091
|
}
|
|
44103
44092
|
const cache = (_a = host.getModuleSpecifierCache) == null ? void 0 : _a.call(host);
|
|
44104
44093
|
const cached = cache == null ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options);
|
|
44105
|
-
return [cached == null ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached == null ? void 0 : cached.modulePaths, cache];
|
|
44094
|
+
return [cached == null ? void 0 : cached.kind, cached == null ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached == null ? void 0 : cached.modulePaths, cache];
|
|
44106
44095
|
}
|
|
44107
44096
|
function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
44108
44097
|
return getModuleSpecifiersWithCacheInfo(
|
|
@@ -44120,16 +44109,16 @@ function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSo
|
|
|
44120
44109
|
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
44121
44110
|
let computedWithoutCache = false;
|
|
44122
44111
|
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
44123
|
-
if (ambient) return { moduleSpecifiers: [ambient], computedWithoutCache };
|
|
44124
|
-
let [specifiers, moduleSourceFile, modulePaths, cache] = tryGetModuleSpecifiersFromCacheWorker(
|
|
44112
|
+
if (ambient) return { kind: "ambient", moduleSpecifiers: [ambient], computedWithoutCache };
|
|
44113
|
+
let [kind, specifiers, moduleSourceFile, modulePaths, cache] = tryGetModuleSpecifiersFromCacheWorker(
|
|
44125
44114
|
moduleSymbol,
|
|
44126
44115
|
importingSourceFile,
|
|
44127
44116
|
host,
|
|
44128
44117
|
userPreferences,
|
|
44129
44118
|
options
|
|
44130
44119
|
);
|
|
44131
|
-
if (specifiers) return { moduleSpecifiers: specifiers, computedWithoutCache };
|
|
44132
|
-
if (!moduleSourceFile) return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
44120
|
+
if (specifiers) return { kind, moduleSpecifiers: specifiers, computedWithoutCache };
|
|
44121
|
+
if (!moduleSourceFile) return { kind: void 0, moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
44133
44122
|
computedWithoutCache = true;
|
|
44134
44123
|
modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host, compilerOptions, options));
|
|
44135
44124
|
const result = computeModuleSpecifiers(
|
|
@@ -44141,8 +44130,8 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
44141
44130
|
options,
|
|
44142
44131
|
forAutoImport
|
|
44143
44132
|
);
|
|
44144
|
-
cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
44145
|
-
return
|
|
44133
|
+
cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, result.kind, modulePaths, result.moduleSpecifiers);
|
|
44134
|
+
return result;
|
|
44146
44135
|
}
|
|
44147
44136
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
44148
44137
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
@@ -44161,8 +44150,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
44161
44150
|
}
|
|
44162
44151
|
));
|
|
44163
44152
|
if (existingSpecifier) {
|
|
44164
|
-
|
|
44165
|
-
return moduleSpecifiers;
|
|
44153
|
+
return { kind: void 0, moduleSpecifiers: [existingSpecifier], computedWithoutCache: true };
|
|
44166
44154
|
}
|
|
44167
44155
|
const importedFileIsInNodeModules = some(modulePaths, (p) => p.isInNodeModules);
|
|
44168
44156
|
let nodeModulesSpecifiers;
|
|
@@ -44183,7 +44171,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
44183
44171
|
) : void 0;
|
|
44184
44172
|
nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier);
|
|
44185
44173
|
if (specifier && modulePath.isRedirect) {
|
|
44186
|
-
return nodeModulesSpecifiers;
|
|
44174
|
+
return { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true };
|
|
44187
44175
|
}
|
|
44188
44176
|
if (!specifier) {
|
|
44189
44177
|
const local = getLocalModuleSpecifier(
|
|
@@ -44212,7 +44200,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
44212
44200
|
}
|
|
44213
44201
|
}
|
|
44214
44202
|
}
|
|
44215
|
-
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers);
|
|
44203
|
+
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? { kind: "paths", moduleSpecifiers: pathsSpecifiers, computedWithoutCache: true } : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? { kind: "redirect", moduleSpecifiers: redirectPathsSpecifiers, computedWithoutCache: true } : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true } : { kind: "relative", moduleSpecifiers: Debug.checkDefined(relativeSpecifiers), computedWithoutCache: true };
|
|
44216
44204
|
}
|
|
44217
44205
|
function getInfo(importingSourceFileName, host) {
|
|
44218
44206
|
importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory());
|
|
@@ -45058,7 +45046,6 @@ function createTypeChecker(host) {
|
|
|
45058
45046
|
var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
|
45059
45047
|
var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply");
|
|
45060
45048
|
var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
|
|
45061
|
-
var strictBuiltinIteratorReturn = getStrictOptionValue(compilerOptions, "strictBuiltinIteratorReturn");
|
|
45062
45049
|
var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
45063
45050
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
45064
45051
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
@@ -45069,7 +45056,6 @@ function createTypeChecker(host) {
|
|
|
45069
45056
|
var syntacticNodeBuilder = createSyntacticTypeNodeBuilder(compilerOptions, {
|
|
45070
45057
|
isEntityNameVisible,
|
|
45071
45058
|
isExpandoFunctionDeclaration,
|
|
45072
|
-
isNonNarrowedBindableName,
|
|
45073
45059
|
getAllAccessorDeclarations: getAllAccessorDeclarationsForDeclaration,
|
|
45074
45060
|
requiresAddingImplicitUndefined,
|
|
45075
45061
|
isUndefinedIdentifierExpression(node) {
|
|
@@ -45396,13 +45382,13 @@ function createTypeChecker(host) {
|
|
|
45396
45382
|
/*reportErrors*/
|
|
45397
45383
|
false
|
|
45398
45384
|
),
|
|
45399
|
-
|
|
45385
|
+
getAsyncIterableType: () => {
|
|
45400
45386
|
const type = getGlobalAsyncIterableType(
|
|
45401
45387
|
/*reportErrors*/
|
|
45402
45388
|
false
|
|
45403
45389
|
);
|
|
45404
45390
|
if (type === emptyGenericType) return void 0;
|
|
45405
|
-
return
|
|
45391
|
+
return type;
|
|
45406
45392
|
},
|
|
45407
45393
|
isSymbolAccessible,
|
|
45408
45394
|
isArrayType,
|
|
@@ -45875,6 +45861,7 @@ function createTypeChecker(host) {
|
|
|
45875
45861
|
};
|
|
45876
45862
|
var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
|
|
45877
45863
|
var anyIterationTypesExceptNext = createIterationTypes(anyType, anyType, unknownType);
|
|
45864
|
+
var defaultIterationTypes = createIterationTypes(neverType, anyType, undefinedType);
|
|
45878
45865
|
var asyncIterationTypesResolver = {
|
|
45879
45866
|
iterableCacheKey: "iterationTypesOfAsyncIterable",
|
|
45880
45867
|
iteratorCacheKey: "iterationTypesOfAsyncIterator",
|
|
@@ -46107,8 +46094,8 @@ function createTypeChecker(host) {
|
|
|
46107
46094
|
void 0
|
|
46108
46095
|
);
|
|
46109
46096
|
}
|
|
46110
|
-
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
46111
|
-
getDiagnostics(sourceFile, cancellationToken2);
|
|
46097
|
+
function getEmitResolver(sourceFile, cancellationToken2, skipDiagnostics) {
|
|
46098
|
+
if (!skipDiagnostics) getDiagnostics(sourceFile, cancellationToken2);
|
|
46112
46099
|
return emitResolver;
|
|
46113
46100
|
}
|
|
46114
46101
|
function lookupOrIssueError(location, message, ...args) {
|
|
@@ -49036,8 +49023,15 @@ function createTypeChecker(host) {
|
|
|
49036
49023
|
).accessibility === 0 /* Accessible */) {
|
|
49037
49024
|
return { accessibility: 0 /* Accessible */ };
|
|
49038
49025
|
}
|
|
49039
|
-
|
|
49040
|
-
|
|
49026
|
+
if (!symbol) {
|
|
49027
|
+
return {
|
|
49028
|
+
accessibility: 3 /* NotResolved */,
|
|
49029
|
+
errorSymbolName: getTextOfNode(firstIdentifier),
|
|
49030
|
+
errorNode: firstIdentifier
|
|
49031
|
+
};
|
|
49032
|
+
}
|
|
49033
|
+
return hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) || {
|
|
49034
|
+
accessibility: 1 /* NotAccessible */,
|
|
49041
49035
|
errorSymbolName: getTextOfNode(firstIdentifier),
|
|
49042
49036
|
errorNode: firstIdentifier
|
|
49043
49037
|
};
|
|
@@ -49929,37 +49923,7 @@ function createTypeChecker(host) {
|
|
|
49929
49923
|
}
|
|
49930
49924
|
let typeArgumentNodes;
|
|
49931
49925
|
if (typeArguments.length > 0) {
|
|
49932
|
-
|
|
49933
|
-
if (type2.target.typeParameters) {
|
|
49934
|
-
typeParameterCount = Math.min(type2.target.typeParameters.length, typeArguments.length);
|
|
49935
|
-
if (isReferenceToType(type2, getGlobalIterableType(
|
|
49936
|
-
/*reportErrors*/
|
|
49937
|
-
false
|
|
49938
|
-
)) || isReferenceToType(type2, getGlobalIterableIteratorType(
|
|
49939
|
-
/*reportErrors*/
|
|
49940
|
-
false
|
|
49941
|
-
)) || isReferenceToType(type2, getGlobalAsyncIterableType(
|
|
49942
|
-
/*reportErrors*/
|
|
49943
|
-
false
|
|
49944
|
-
)) || isReferenceToType(type2, getGlobalAsyncIterableIteratorType(
|
|
49945
|
-
/*reportErrors*/
|
|
49946
|
-
false
|
|
49947
|
-
))) {
|
|
49948
|
-
if (!type2.node || !isTypeReferenceNode(type2.node) || !type2.node.typeArguments || type2.node.typeArguments.length < typeParameterCount) {
|
|
49949
|
-
while (typeParameterCount > 0) {
|
|
49950
|
-
const typeArgument = typeArguments[typeParameterCount - 1];
|
|
49951
|
-
const typeParameter = type2.target.typeParameters[typeParameterCount - 1];
|
|
49952
|
-
const defaultType = getDefaultFromTypeParameter(typeParameter);
|
|
49953
|
-
if (!defaultType || !isTypeIdenticalTo(typeArgument, defaultType)) {
|
|
49954
|
-
break;
|
|
49955
|
-
}
|
|
49956
|
-
typeParameterCount--;
|
|
49957
|
-
}
|
|
49958
|
-
}
|
|
49959
|
-
}
|
|
49960
|
-
} else {
|
|
49961
|
-
typeParameterCount = 0;
|
|
49962
|
-
}
|
|
49926
|
+
const typeParameterCount = (type2.target.typeParameters || emptyArray).length;
|
|
49963
49927
|
typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i, typeParameterCount), context);
|
|
49964
49928
|
}
|
|
49965
49929
|
const flags = context.flags;
|
|
@@ -55135,9 +55099,6 @@ function createTypeChecker(host) {
|
|
|
55135
55099
|
links.instantiations = /* @__PURE__ */ new Map();
|
|
55136
55100
|
links.instantiations.set(getTypeListId(typeParameters), type);
|
|
55137
55101
|
}
|
|
55138
|
-
if (type === intrinsicMarkerType && symbol.escapedName === "BuiltinIteratorReturn") {
|
|
55139
|
-
type = strictBuiltinIteratorReturn ? undefinedType : anyType;
|
|
55140
|
-
}
|
|
55141
55102
|
} else {
|
|
55142
55103
|
type = errorType;
|
|
55143
55104
|
if (declaration.kind === 340 /* JSDocEnumTag */) {
|
|
@@ -58396,7 +58357,7 @@ function createTypeChecker(host) {
|
|
|
58396
58357
|
return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType(
|
|
58397
58358
|
"AsyncIterable",
|
|
58398
58359
|
/*arity*/
|
|
58399
|
-
|
|
58360
|
+
1,
|
|
58400
58361
|
reportErrors2
|
|
58401
58362
|
)) || emptyGenericType;
|
|
58402
58363
|
}
|
|
@@ -58412,7 +58373,7 @@ function createTypeChecker(host) {
|
|
|
58412
58373
|
return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType(
|
|
58413
58374
|
"AsyncIterableIterator",
|
|
58414
58375
|
/*arity*/
|
|
58415
|
-
|
|
58376
|
+
1,
|
|
58416
58377
|
reportErrors2
|
|
58417
58378
|
)) || emptyGenericType;
|
|
58418
58379
|
}
|
|
@@ -58428,7 +58389,7 @@ function createTypeChecker(host) {
|
|
|
58428
58389
|
return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType(
|
|
58429
58390
|
"Iterable",
|
|
58430
58391
|
/*arity*/
|
|
58431
|
-
|
|
58392
|
+
1,
|
|
58432
58393
|
reportErrors2
|
|
58433
58394
|
)) || emptyGenericType;
|
|
58434
58395
|
}
|
|
@@ -58444,7 +58405,7 @@ function createTypeChecker(host) {
|
|
|
58444
58405
|
return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType(
|
|
58445
58406
|
"IterableIterator",
|
|
58446
58407
|
/*arity*/
|
|
58447
|
-
|
|
58408
|
+
1,
|
|
58448
58409
|
reportErrors2
|
|
58449
58410
|
)) || emptyGenericType;
|
|
58450
58411
|
}
|
|
@@ -58626,7 +58587,7 @@ function createTypeChecker(host) {
|
|
|
58626
58587
|
return createTypeFromGenericGlobalType(getGlobalIterableType(
|
|
58627
58588
|
/*reportErrors*/
|
|
58628
58589
|
true
|
|
58629
|
-
), [iteratedType
|
|
58590
|
+
), [iteratedType]);
|
|
58630
58591
|
}
|
|
58631
58592
|
function createArrayType(elementType, readonly) {
|
|
58632
58593
|
return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]);
|
|
@@ -58935,6 +58896,7 @@ function createTypeChecker(host) {
|
|
|
58935
58896
|
if (flags & 465829888 /* Instantiable */) includes |= 33554432 /* IncludesInstantiable */;
|
|
58936
58897
|
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsConstrainedTypeVariable */) includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
58937
58898
|
if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */;
|
|
58899
|
+
if (isErrorType(type)) includes |= 1073741824 /* IncludesError */;
|
|
58938
58900
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
58939
58901
|
if (!(getObjectFlags(type) & 65536 /* ContainsWideningType */)) includes |= 4194304 /* IncludesNonWideningType */;
|
|
58940
58902
|
} else {
|
|
@@ -59126,7 +59088,7 @@ function createTypeChecker(host) {
|
|
|
59126
59088
|
const includes = addTypesToUnion(typeSet, 0, types);
|
|
59127
59089
|
if (unionReduction !== 0 /* None */) {
|
|
59128
59090
|
if (includes & 3 /* AnyOrUnknown */) {
|
|
59129
|
-
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType : unknownType;
|
|
59091
|
+
return includes & 1 /* Any */ ? includes & 8388608 /* IncludesWildcard */ ? wildcardType : includes & 1073741824 /* IncludesError */ ? errorType : anyType : unknownType;
|
|
59130
59092
|
}
|
|
59131
59093
|
if (includes & 32768 /* Undefined */) {
|
|
59132
59094
|
if (typeSet.length >= 2 && typeSet[0] === undefinedType && typeSet[1] === missingType) {
|
|
@@ -59252,6 +59214,7 @@ function createTypeChecker(host) {
|
|
|
59252
59214
|
} else {
|
|
59253
59215
|
if (flags & 3 /* AnyOrUnknown */) {
|
|
59254
59216
|
if (type === wildcardType) includes |= 8388608 /* IncludesWildcard */;
|
|
59217
|
+
if (isErrorType(type)) includes |= 1073741824 /* IncludesError */;
|
|
59255
59218
|
} else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
|
|
59256
59219
|
if (type === missingType) {
|
|
59257
59220
|
includes |= 262144 /* IncludesMissingType */;
|
|
@@ -59379,7 +59342,7 @@ function createTypeChecker(host) {
|
|
|
59379
59342
|
return neverType;
|
|
59380
59343
|
}
|
|
59381
59344
|
if (includes & 1 /* Any */) {
|
|
59382
|
-
return includes & 8388608 /* IncludesWildcard */ ? wildcardType : anyType;
|
|
59345
|
+
return includes & 8388608 /* IncludesWildcard */ ? wildcardType : includes & 1073741824 /* IncludesError */ ? errorType : anyType;
|
|
59383
59346
|
}
|
|
59384
59347
|
if (!strictNullChecks && includes & 98304 /* Nullable */) {
|
|
59385
59348
|
return includes & 16777216 /* IncludesEmptyObject */ ? neverType : includes & 32768 /* Undefined */ ? undefinedType : nullType;
|
|
@@ -76018,14 +75981,24 @@ function createTypeChecker(host) {
|
|
|
76018
75981
|
void 0
|
|
76019
75982
|
) || unknownType;
|
|
76020
75983
|
if (globalGeneratorType === emptyGenericType) {
|
|
76021
|
-
const
|
|
75984
|
+
const globalType = resolver.getGlobalIterableIteratorType(
|
|
76022
75985
|
/*reportErrors*/
|
|
76023
75986
|
false
|
|
76024
75987
|
);
|
|
76025
|
-
|
|
76026
|
-
|
|
75988
|
+
const iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : void 0;
|
|
75989
|
+
const iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType;
|
|
75990
|
+
const iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType;
|
|
75991
|
+
if (isTypeAssignableTo(returnType, iterableIteratorReturnType) && isTypeAssignableTo(iterableIteratorNextType, nextType)) {
|
|
75992
|
+
if (globalType !== emptyGenericType) {
|
|
75993
|
+
return createTypeFromGenericGlobalType(globalType, [yieldType]);
|
|
75994
|
+
}
|
|
75995
|
+
resolver.getGlobalIterableIteratorType(
|
|
75996
|
+
/*reportErrors*/
|
|
75997
|
+
true
|
|
75998
|
+
);
|
|
75999
|
+
return emptyObjectType;
|
|
76027
76000
|
}
|
|
76028
|
-
resolver.
|
|
76001
|
+
resolver.getGlobalGeneratorType(
|
|
76029
76002
|
/*reportErrors*/
|
|
76030
76003
|
true
|
|
76031
76004
|
);
|
|
@@ -81052,14 +81025,41 @@ function createTypeChecker(host) {
|
|
|
81052
81025
|
function getIterationTypesOfIterableCached(type, resolver) {
|
|
81053
81026
|
return getCachedIterationTypes(type, resolver.iterableCacheKey);
|
|
81054
81027
|
}
|
|
81028
|
+
function getIterationTypesOfGlobalIterableType(globalType, resolver) {
|
|
81029
|
+
const globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) || getIterationTypesOfIterableSlow(
|
|
81030
|
+
globalType,
|
|
81031
|
+
resolver,
|
|
81032
|
+
/*errorNode*/
|
|
81033
|
+
void 0,
|
|
81034
|
+
/*errorOutputContainer*/
|
|
81035
|
+
void 0,
|
|
81036
|
+
/*noCache*/
|
|
81037
|
+
false
|
|
81038
|
+
);
|
|
81039
|
+
return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
81040
|
+
}
|
|
81055
81041
|
function getIterationTypesOfIterableFast(type, resolver) {
|
|
81056
|
-
|
|
81042
|
+
let globalType;
|
|
81043
|
+
if (isReferenceToType(type, globalType = resolver.getGlobalIterableType(
|
|
81057
81044
|
/*reportErrors*/
|
|
81058
81045
|
false
|
|
81059
|
-
)) || isReferenceToType(type, resolver.getGlobalIterableIteratorType(
|
|
81046
|
+
)) || isReferenceToType(type, globalType = resolver.getGlobalIterableIteratorType(
|
|
81060
81047
|
/*reportErrors*/
|
|
81061
81048
|
false
|
|
81062
|
-
))
|
|
81049
|
+
))) {
|
|
81050
|
+
const [yieldType] = getTypeArguments(type);
|
|
81051
|
+
const { returnType, nextType } = getIterationTypesOfGlobalIterableType(globalType, resolver);
|
|
81052
|
+
return setCachedIterationTypes(type, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType(
|
|
81053
|
+
yieldType,
|
|
81054
|
+
/*errorNode*/
|
|
81055
|
+
void 0
|
|
81056
|
+
) || yieldType, resolver.resolveIterationType(
|
|
81057
|
+
returnType,
|
|
81058
|
+
/*errorNode*/
|
|
81059
|
+
void 0
|
|
81060
|
+
) || returnType, nextType));
|
|
81061
|
+
}
|
|
81062
|
+
if (isReferenceToType(type, resolver.getGlobalGeneratorType(
|
|
81063
81063
|
/*reportErrors*/
|
|
81064
81064
|
false
|
|
81065
81065
|
))) {
|
|
@@ -81104,10 +81104,10 @@ function createTypeChecker(host) {
|
|
|
81104
81104
|
!!getAwaitedTypeOfPromise(type) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType(
|
|
81105
81105
|
/*reportErrors*/
|
|
81106
81106
|
false
|
|
81107
|
-
) !== emptyGenericType && isTypeAssignableTo(type,
|
|
81107
|
+
) !== emptyGenericType && isTypeAssignableTo(type, getGlobalAsyncIterableType(
|
|
81108
81108
|
/*reportErrors*/
|
|
81109
81109
|
false
|
|
81110
|
-
)
|
|
81110
|
+
))
|
|
81111
81111
|
);
|
|
81112
81112
|
return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
|
|
81113
81113
|
}
|
|
@@ -81137,10 +81137,26 @@ function createTypeChecker(host) {
|
|
|
81137
81137
|
return getCachedIterationTypes(type, resolver.iteratorCacheKey);
|
|
81138
81138
|
}
|
|
81139
81139
|
function getIterationTypesOfIteratorFast(type, resolver) {
|
|
81140
|
-
|
|
81140
|
+
const globalType = resolver.getGlobalIterableIteratorType(
|
|
81141
81141
|
/*reportErrors*/
|
|
81142
81142
|
false
|
|
81143
|
-
)
|
|
81143
|
+
);
|
|
81144
|
+
if (isReferenceToType(type, globalType)) {
|
|
81145
|
+
const [yieldType] = getTypeArguments(type);
|
|
81146
|
+
const globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) || getIterationTypesOfIteratorSlow(
|
|
81147
|
+
globalType,
|
|
81148
|
+
resolver,
|
|
81149
|
+
/*errorNode*/
|
|
81150
|
+
void 0,
|
|
81151
|
+
/*errorOutputContainer*/
|
|
81152
|
+
void 0,
|
|
81153
|
+
/*noCache*/
|
|
81154
|
+
false
|
|
81155
|
+
);
|
|
81156
|
+
const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
|
|
81157
|
+
return setCachedIterationTypes(type, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType));
|
|
81158
|
+
}
|
|
81159
|
+
if (isReferenceToType(type, resolver.getGlobalIteratorType(
|
|
81144
81160
|
/*reportErrors*/
|
|
81145
81161
|
false
|
|
81146
81162
|
)) || isReferenceToType(type, resolver.getGlobalGeneratorType(
|
|
@@ -82356,9 +82372,7 @@ function createTypeChecker(host) {
|
|
|
82356
82372
|
checkExportsOnMergedDeclarations(node);
|
|
82357
82373
|
checkTypeParameters(node.typeParameters);
|
|
82358
82374
|
if (node.type.kind === 141 /* IntrinsicKeyword */) {
|
|
82359
|
-
|
|
82360
|
-
const valid = typeParameterCount === 0 ? node.name.escapedText === "BuiltinIteratorReturn" : typeParameterCount === 1 && intrinsicTypeKinds.has(node.name.escapedText);
|
|
82361
|
-
if (!valid) {
|
|
82375
|
+
if (!intrinsicTypeKinds.has(node.name.escapedText) || length(node.typeParameters) !== 1) {
|
|
82362
82376
|
error(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);
|
|
82363
82377
|
}
|
|
82364
82378
|
} else {
|
|
@@ -84965,22 +84979,6 @@ function createTypeChecker(host) {
|
|
|
84965
84979
|
}
|
|
84966
84980
|
return false;
|
|
84967
84981
|
}
|
|
84968
|
-
function isNonNarrowedBindableName(node) {
|
|
84969
|
-
if (!hasBindableName(node.parent)) {
|
|
84970
|
-
return false;
|
|
84971
|
-
}
|
|
84972
|
-
const expression = node.expression;
|
|
84973
|
-
if (!isEntityNameExpression(expression)) {
|
|
84974
|
-
return true;
|
|
84975
|
-
}
|
|
84976
|
-
const type = getTypeOfExpression(expression);
|
|
84977
|
-
const symbol = getSymbolAtLocation(expression);
|
|
84978
|
-
if (!symbol) {
|
|
84979
|
-
return false;
|
|
84980
|
-
}
|
|
84981
|
-
const declaredType = getTypeOfSymbol(symbol);
|
|
84982
|
-
return declaredType === type;
|
|
84983
|
-
}
|
|
84984
84982
|
function literalTypeToNode(type, enclosing, tracker) {
|
|
84985
84983
|
const enumResult = type.flags & 1056 /* EnumLike */ ? nodeBuilder.symbolToExpression(
|
|
84986
84984
|
type.symbol,
|
|
@@ -85099,7 +85097,6 @@ function createTypeChecker(host) {
|
|
|
85099
85097
|
return node && getExternalModuleFileFromDeclaration(node);
|
|
85100
85098
|
},
|
|
85101
85099
|
isLiteralConstDeclaration,
|
|
85102
|
-
isNonNarrowedBindableName,
|
|
85103
85100
|
isLateBound: (nodeIn) => {
|
|
85104
85101
|
const node = getParseTreeNode(nodeIn, isDeclaration);
|
|
85105
85102
|
const symbol = node && getSymbolOfDeclaration(node);
|
|
@@ -110019,7 +110016,7 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
110019
110016
|
[260 /* VariableDeclaration */]: Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
|
|
110020
110017
|
[172 /* PropertyDeclaration */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
|
|
110021
110018
|
[171 /* PropertySignature */]: Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations,
|
|
110022
|
-
[167 /* ComputedPropertyName */]: Diagnostics.
|
|
110019
|
+
[167 /* ComputedPropertyName */]: Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations,
|
|
110023
110020
|
[305 /* SpreadAssignment */]: Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations,
|
|
110024
110021
|
[304 /* ShorthandPropertyAssignment */]: Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations,
|
|
110025
110022
|
[209 /* ArrayLiteralExpression */]: Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations,
|
|
@@ -110885,8 +110882,11 @@ function transformDeclarations(context) {
|
|
|
110885
110882
|
if (shouldStripInternal(input)) return;
|
|
110886
110883
|
if (isDeclaration(input)) {
|
|
110887
110884
|
if (isDeclarationAndNotVisible(input)) return;
|
|
110888
|
-
if (hasDynamicName(input)
|
|
110889
|
-
if (isolatedDeclarations && isClassDeclaration(input.parent)
|
|
110885
|
+
if (hasDynamicName(input)) {
|
|
110886
|
+
if (isolatedDeclarations && (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent))) {
|
|
110887
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
110888
|
+
}
|
|
110889
|
+
if (isolatedDeclarations && (isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)) {
|
|
110890
110890
|
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
|
|
110891
110891
|
}
|
|
110892
110892
|
if (!isEntityNameExpression(input.name.expression)) {
|
|
@@ -112459,6 +112459,9 @@ function getFirstProjectOutput(configFile, ignoreCase) {
|
|
|
112459
112459
|
if (buildInfoPath) return buildInfoPath;
|
|
112460
112460
|
return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`);
|
|
112461
112461
|
}
|
|
112462
|
+
function emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) {
|
|
112463
|
+
return !!forceDtsEmit && !!emitOnly;
|
|
112464
|
+
}
|
|
112462
112465
|
function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) {
|
|
112463
112466
|
var compilerOptions = host.getCompilerOptions();
|
|
112464
112467
|
var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0;
|
|
@@ -112576,7 +112579,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
112576
112579
|
const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;
|
|
112577
112580
|
const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson);
|
|
112578
112581
|
const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit;
|
|
112579
|
-
if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck) {
|
|
112582
|
+
if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck || emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit)) {
|
|
112580
112583
|
filesForEmit.forEach(collectLinkedAliases);
|
|
112581
112584
|
}
|
|
112582
112585
|
const declarationTransform = transformNodes(
|
|
@@ -112816,7 +112819,6 @@ var notImplementedResolver = {
|
|
|
112816
112819
|
isArgumentsLocalBinding: notImplemented,
|
|
112817
112820
|
getExternalModuleFileFromDeclaration: notImplemented,
|
|
112818
112821
|
isLiteralConstDeclaration: notImplemented,
|
|
112819
|
-
isNonNarrowedBindableName: notImplemented,
|
|
112820
112822
|
getJsxFactoryEntity: notImplemented,
|
|
112821
112823
|
getJsxFragmentFactoryEntity: notImplemented,
|
|
112822
112824
|
isBindingCapturedByNode: notImplemented,
|
|
@@ -119512,17 +119514,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119512
119514
|
const result = handleNoEmitOptions(program2, sourceFile, writeFileCallback, cancellationToken);
|
|
119513
119515
|
if (result) return result;
|
|
119514
119516
|
}
|
|
119515
|
-
const
|
|
119517
|
+
const typeChecker2 = getTypeChecker();
|
|
119518
|
+
const emitResolver = typeChecker2.getEmitResolver(
|
|
119519
|
+
options.outFile ? void 0 : sourceFile,
|
|
119520
|
+
cancellationToken,
|
|
119521
|
+
emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit)
|
|
119522
|
+
);
|
|
119516
119523
|
mark("beforeEmit");
|
|
119517
|
-
const emitResult =
|
|
119518
|
-
|
|
119519
|
-
|
|
119520
|
-
|
|
119521
|
-
|
|
119522
|
-
|
|
119523
|
-
|
|
119524
|
-
|
|
119525
|
-
|
|
119524
|
+
const emitResult = typeChecker2.runWithCancellationToken(
|
|
119525
|
+
cancellationToken,
|
|
119526
|
+
() => emitFiles(
|
|
119527
|
+
emitResolver,
|
|
119528
|
+
getEmitHost(writeFileCallback),
|
|
119529
|
+
sourceFile,
|
|
119530
|
+
getTransformers(options, customTransformers, emitOnly),
|
|
119531
|
+
emitOnly,
|
|
119532
|
+
/*onlyBuildInfo*/
|
|
119533
|
+
false,
|
|
119534
|
+
forceDtsEmit
|
|
119535
|
+
)
|
|
119526
119536
|
);
|
|
119527
119537
|
mark("afterEmit");
|
|
119528
119538
|
measure("Emit", "beforeEmit", "afterEmit");
|
|
@@ -120262,7 +120272,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120262
120272
|
return file2 || void 0;
|
|
120263
120273
|
}
|
|
120264
120274
|
let redirectedPath;
|
|
120265
|
-
if (
|
|
120275
|
+
if (!useSourceOfProjectReferenceRedirect) {
|
|
120266
120276
|
const redirectProject = getProjectReferenceRedirectProject(fileName);
|
|
120267
120277
|
if (redirectProject) {
|
|
120268
120278
|
if (redirectProject.commandLine.options.outFile) {
|
|
@@ -122473,7 +122483,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
|
|
|
122473
122483
|
host
|
|
122474
122484
|
);
|
|
122475
122485
|
}
|
|
122476
|
-
function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
122486
|
+
function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
|
|
122477
122487
|
removeSemanticDiagnosticsOf(state, path);
|
|
122478
122488
|
if (!state.changedFilesSet.has(path)) {
|
|
122479
122489
|
const program = Debug.checkDefined(state.program);
|
|
@@ -122488,7 +122498,9 @@ function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
|
122488
122498
|
/*useFileVersionAsSignature*/
|
|
122489
122499
|
true
|
|
122490
122500
|
);
|
|
122491
|
-
if (
|
|
122501
|
+
if (invalidateJsFiles) {
|
|
122502
|
+
addToAffectedFilesPendingEmit(state, path, getBuilderFileEmit(state.compilerOptions));
|
|
122503
|
+
} else if (getEmitDeclarations(state.compilerOptions)) {
|
|
122492
122504
|
addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
|
|
122493
122505
|
}
|
|
122494
122506
|
}
|
|
@@ -122507,7 +122519,7 @@ function isChangedSignature(state, path) {
|
|
|
122507
122519
|
const newSignature = Debug.checkDefined(state.fileInfos.get(path)).signature;
|
|
122508
122520
|
return newSignature !== oldSignature;
|
|
122509
122521
|
}
|
|
122510
|
-
function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host) {
|
|
122522
|
+
function handleDtsMayChangeOfGlobalScope(state, filePath, invalidateJsFiles, cancellationToken, host) {
|
|
122511
122523
|
var _a;
|
|
122512
122524
|
if (!((_a = state.fileInfos.get(filePath)) == null ? void 0 : _a.affectsGlobalScope)) return false;
|
|
122513
122525
|
BuilderState.getAllFilesExcludingDefaultLibraryFile(
|
|
@@ -122519,6 +122531,7 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, hos
|
|
|
122519
122531
|
(file) => handleDtsMayChangeOf(
|
|
122520
122532
|
state,
|
|
122521
122533
|
file.resolvedPath,
|
|
122534
|
+
invalidateJsFiles,
|
|
122522
122535
|
cancellationToken,
|
|
122523
122536
|
host
|
|
122524
122537
|
)
|
|
@@ -122527,7 +122540,7 @@ function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, hos
|
|
|
122527
122540
|
return true;
|
|
122528
122541
|
}
|
|
122529
122542
|
function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) {
|
|
122530
|
-
var _a;
|
|
122543
|
+
var _a, _b;
|
|
122531
122544
|
if (!state.referencedMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) return;
|
|
122532
122545
|
if (!isChangedSignature(state, affectedFile.resolvedPath)) return;
|
|
122533
122546
|
if (getIsolatedModules(state.compilerOptions)) {
|
|
@@ -122538,8 +122551,22 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
122538
122551
|
const currentPath = queue.pop();
|
|
122539
122552
|
if (!seenFileNamesMap.has(currentPath)) {
|
|
122540
122553
|
seenFileNamesMap.set(currentPath, true);
|
|
122541
|
-
if (handleDtsMayChangeOfGlobalScope(
|
|
122542
|
-
|
|
122554
|
+
if (handleDtsMayChangeOfGlobalScope(
|
|
122555
|
+
state,
|
|
122556
|
+
currentPath,
|
|
122557
|
+
/*invalidateJsFiles*/
|
|
122558
|
+
false,
|
|
122559
|
+
cancellationToken,
|
|
122560
|
+
host
|
|
122561
|
+
)) return;
|
|
122562
|
+
handleDtsMayChangeOf(
|
|
122563
|
+
state,
|
|
122564
|
+
currentPath,
|
|
122565
|
+
/*invalidateJsFiles*/
|
|
122566
|
+
false,
|
|
122567
|
+
cancellationToken,
|
|
122568
|
+
host
|
|
122569
|
+
);
|
|
122543
122570
|
if (isChangedSignature(state, currentPath)) {
|
|
122544
122571
|
const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
|
|
122545
122572
|
queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
|
|
@@ -122548,27 +122575,38 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
|
|
|
122548
122575
|
}
|
|
122549
122576
|
}
|
|
122550
122577
|
const seenFileAndExportsOfFile = /* @__PURE__ */ new Set();
|
|
122551
|
-
(_a =
|
|
122552
|
-
|
|
122578
|
+
const invalidateJsFiles = !!((_a = affectedFile.symbol) == null ? void 0 : _a.exports) && !!forEachEntry(
|
|
122579
|
+
affectedFile.symbol.exports,
|
|
122580
|
+
(exported) => {
|
|
122581
|
+
if ((exported.flags & 128 /* ConstEnum */) !== 0) return true;
|
|
122582
|
+
const aliased = skipAlias(exported, state.program.getTypeChecker());
|
|
122583
|
+
if (aliased === exported) return false;
|
|
122584
|
+
return (aliased.flags & 128 /* ConstEnum */) !== 0 && some(aliased.declarations, (d) => getSourceFileOfNode(d) === affectedFile);
|
|
122585
|
+
}
|
|
122586
|
+
);
|
|
122587
|
+
(_b = state.referencedMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _b.forEach((exportedFromPath) => {
|
|
122588
|
+
if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, invalidateJsFiles, cancellationToken, host)) return true;
|
|
122553
122589
|
const references = state.referencedMap.getKeys(exportedFromPath);
|
|
122554
122590
|
return references && forEachKey(references, (filePath) => handleDtsMayChangeOfFileAndExportsOfFile(
|
|
122555
122591
|
state,
|
|
122556
122592
|
filePath,
|
|
122593
|
+
invalidateJsFiles,
|
|
122557
122594
|
seenFileAndExportsOfFile,
|
|
122558
122595
|
cancellationToken,
|
|
122559
122596
|
host
|
|
122560
122597
|
));
|
|
122561
122598
|
});
|
|
122562
122599
|
}
|
|
122563
|
-
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) {
|
|
122600
|
+
function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsFiles, seenFileAndExportsOfFile, cancellationToken, host) {
|
|
122564
122601
|
var _a;
|
|
122565
122602
|
if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) return void 0;
|
|
122566
|
-
if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host)) return true;
|
|
122567
|
-
handleDtsMayChangeOf(state, filePath, cancellationToken, host);
|
|
122603
|
+
if (handleDtsMayChangeOfGlobalScope(state, filePath, invalidateJsFiles, cancellationToken, host)) return true;
|
|
122604
|
+
handleDtsMayChangeOf(state, filePath, invalidateJsFiles, cancellationToken, host);
|
|
122568
122605
|
(_a = state.referencedMap.getKeys(filePath)) == null ? void 0 : _a.forEach(
|
|
122569
122606
|
(referencingFilePath) => handleDtsMayChangeOfFileAndExportsOfFile(
|
|
122570
122607
|
state,
|
|
122571
122608
|
referencingFilePath,
|
|
122609
|
+
invalidateJsFiles,
|
|
122572
122610
|
seenFileAndExportsOfFile,
|
|
122573
122611
|
cancellationToken,
|
|
122574
122612
|
host
|
|
@@ -122607,6 +122645,7 @@ function getBuildInfo2(state) {
|
|
|
122607
122645
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
122608
122646
|
const fileNames = [];
|
|
122609
122647
|
const fileNameToFileId = /* @__PURE__ */ new Map();
|
|
122648
|
+
const rootFileNames = new Set(state.program.getRootFileNames().map((f) => toPath(f, currentDirectory, state.program.getCanonicalFileName)));
|
|
122610
122649
|
const root = [];
|
|
122611
122650
|
if (state.compilerOptions.outFile) {
|
|
122612
122651
|
const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
|
|
@@ -122618,6 +122657,7 @@ function getBuildInfo2(state) {
|
|
|
122618
122657
|
fileNames,
|
|
122619
122658
|
fileInfos: fileInfos2,
|
|
122620
122659
|
root,
|
|
122660
|
+
resolvedRoot: toResolvedRoot(),
|
|
122621
122661
|
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
|
|
122622
122662
|
outSignature: state.outSignature,
|
|
122623
122663
|
latestChangedDtsFile,
|
|
@@ -122647,7 +122687,8 @@ function getBuildInfo2(state) {
|
|
|
122647
122687
|
if (!isJsonSourceFile(file) && sourceFileMayBeEmitted(file, state.program)) {
|
|
122648
122688
|
const emitSignature = (_b = state.emitSignatures) == null ? void 0 : _b.get(key);
|
|
122649
122689
|
if (emitSignature !== actualSignature) {
|
|
122650
|
-
|
|
122690
|
+
emitSignatures = append(
|
|
122691
|
+
emitSignatures,
|
|
122651
122692
|
emitSignature === void 0 ? fileId : (
|
|
122652
122693
|
// There is no emit, encode as false
|
|
122653
122694
|
// fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature
|
|
@@ -122694,7 +122735,8 @@ function getBuildInfo2(state) {
|
|
|
122694
122735
|
const file = state.program.getSourceFileByPath(path);
|
|
122695
122736
|
if (!file || !sourceFileMayBeEmitted(file, state.program)) continue;
|
|
122696
122737
|
const fileId = toFileId(path), pendingEmit = state.affectedFilesPendingEmit.get(path);
|
|
122697
|
-
|
|
122738
|
+
affectedFilesPendingEmit = append(
|
|
122739
|
+
affectedFilesPendingEmit,
|
|
122698
122740
|
pendingEmit === fullEmitForOptions ? fileId : (
|
|
122699
122741
|
// Pending full emit per options
|
|
122700
122742
|
pendingEmit === 8 /* Dts */ ? [fileId] : (
|
|
@@ -122710,7 +122752,7 @@ function getBuildInfo2(state) {
|
|
|
122710
122752
|
let changeFileSet;
|
|
122711
122753
|
if (state.changedFilesSet.size) {
|
|
122712
122754
|
for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) {
|
|
122713
|
-
|
|
122755
|
+
changeFileSet = append(changeFileSet, toFileId(path));
|
|
122714
122756
|
}
|
|
122715
122757
|
}
|
|
122716
122758
|
const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile);
|
|
@@ -122718,6 +122760,7 @@ function getBuildInfo2(state) {
|
|
|
122718
122760
|
fileNames,
|
|
122719
122761
|
fileInfos,
|
|
122720
122762
|
root,
|
|
122763
|
+
resolvedRoot: toResolvedRoot(),
|
|
122721
122764
|
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
|
|
122722
122765
|
fileIdsList,
|
|
122723
122766
|
referencedMap,
|
|
@@ -122748,8 +122791,8 @@ function getBuildInfo2(state) {
|
|
|
122748
122791
|
const key = fileIds.join();
|
|
122749
122792
|
let fileIdListId = fileNamesToFileIdListId == null ? void 0 : fileNamesToFileIdListId.get(key);
|
|
122750
122793
|
if (fileIdListId === void 0) {
|
|
122751
|
-
|
|
122752
|
-
(fileNamesToFileIdListId
|
|
122794
|
+
fileIdsList = append(fileIdsList, fileIds);
|
|
122795
|
+
(fileNamesToFileIdListId ?? (fileNamesToFileIdListId = /* @__PURE__ */ new Map())).set(key, fileIdListId = fileIdsList.length);
|
|
122753
122796
|
}
|
|
122754
122797
|
return fileIdListId;
|
|
122755
122798
|
}
|
|
@@ -122766,6 +122809,16 @@ function getBuildInfo2(state) {
|
|
|
122766
122809
|
root[root.length - 2] = [lastButOne, fileId];
|
|
122767
122810
|
return root.length = root.length - 1;
|
|
122768
122811
|
}
|
|
122812
|
+
function toResolvedRoot() {
|
|
122813
|
+
let result;
|
|
122814
|
+
rootFileNames.forEach((path) => {
|
|
122815
|
+
const file = state.program.getSourceFileByPath(path);
|
|
122816
|
+
if (file && path !== file.resolvedPath) {
|
|
122817
|
+
result = append(result, [toFileId(file.resolvedPath), toFileId(path)]);
|
|
122818
|
+
}
|
|
122819
|
+
});
|
|
122820
|
+
return result;
|
|
122821
|
+
}
|
|
122769
122822
|
function convertToProgramBuildInfoCompilerOptions(options) {
|
|
122770
122823
|
let result;
|
|
122771
122824
|
const { optionsNameMap } = getOptionsNameMap();
|
|
@@ -122799,7 +122852,8 @@ function getBuildInfo2(state) {
|
|
|
122799
122852
|
if (diagnostics) {
|
|
122800
122853
|
for (const key of arrayFrom(diagnostics.keys()).sort(compareStringsCaseSensitive)) {
|
|
122801
122854
|
const value = diagnostics.get(key);
|
|
122802
|
-
|
|
122855
|
+
result = append(
|
|
122856
|
+
result,
|
|
122803
122857
|
value.length ? [
|
|
122804
122858
|
toFileId(key),
|
|
122805
122859
|
convertToReusableDiagnostics(value)
|
|
@@ -123288,7 +123342,8 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
123288
123342
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
123289
123343
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
123290
123344
|
let rootIndex = 0;
|
|
123291
|
-
const roots =
|
|
123345
|
+
const roots = /* @__PURE__ */ new Map();
|
|
123346
|
+
const resolvedRoots = new Map(program.resolvedRoot);
|
|
123292
123347
|
program.fileInfos.forEach((fileInfo, index) => {
|
|
123293
123348
|
const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
|
|
123294
123349
|
const version2 = isString(fileInfo) ? fileInfo : fileInfo.version;
|
|
@@ -123298,16 +123353,24 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
123298
123353
|
const fileId = index + 1;
|
|
123299
123354
|
if (isArray(current)) {
|
|
123300
123355
|
if (current[0] <= fileId && fileId <= current[1]) {
|
|
123301
|
-
|
|
123356
|
+
addRoot(fileId, path);
|
|
123302
123357
|
if (current[1] === fileId) rootIndex++;
|
|
123303
123358
|
}
|
|
123304
123359
|
} else if (current === fileId) {
|
|
123305
|
-
|
|
123360
|
+
addRoot(fileId, path);
|
|
123306
123361
|
rootIndex++;
|
|
123307
123362
|
}
|
|
123308
123363
|
}
|
|
123309
123364
|
});
|
|
123310
123365
|
return { fileInfos, roots };
|
|
123366
|
+
function addRoot(fileId, path) {
|
|
123367
|
+
const root = resolvedRoots.get(fileId);
|
|
123368
|
+
if (root) {
|
|
123369
|
+
roots.set(toPath(program.fileNames[root - 1], buildInfoDirectory, getCanonicalFileName), path);
|
|
123370
|
+
} else {
|
|
123371
|
+
roots.set(path, void 0);
|
|
123372
|
+
}
|
|
123373
|
+
}
|
|
123311
123374
|
}
|
|
123312
123375
|
function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
|
|
123313
123376
|
return {
|
|
@@ -126903,13 +126966,15 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
126903
126966
|
reason: `${inputFile} does not exist`
|
|
126904
126967
|
};
|
|
126905
126968
|
}
|
|
126969
|
+
const inputPath = buildInfoProgram ? toPath2(state, inputFile) : void 0;
|
|
126906
126970
|
if (buildInfoTime && buildInfoTime < inputTime) {
|
|
126907
126971
|
let version2;
|
|
126908
126972
|
let currentVersion;
|
|
126909
126973
|
if (buildInfoProgram) {
|
|
126910
126974
|
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
126911
|
-
|
|
126912
|
-
|
|
126975
|
+
const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
|
|
126976
|
+
version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
|
|
126977
|
+
const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
|
|
126913
126978
|
currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0;
|
|
126914
126979
|
if (version2 && version2 === currentVersion) pseudoInputUpToDate = true;
|
|
126915
126980
|
}
|
|
@@ -126925,18 +126990,21 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
126925
126990
|
newestInputFileName = inputFile;
|
|
126926
126991
|
newestInputFileTime = inputTime;
|
|
126927
126992
|
}
|
|
126928
|
-
if (buildInfoProgram) seenRoots.add(
|
|
126993
|
+
if (buildInfoProgram) seenRoots.add(inputPath);
|
|
126929
126994
|
}
|
|
126930
126995
|
if (buildInfoProgram) {
|
|
126931
126996
|
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
|
|
126932
|
-
|
|
126933
|
-
|
|
126934
|
-
|
|
126935
|
-
|
|
126936
|
-
|
|
126937
|
-
|
|
126938
|
-
|
|
126939
|
-
|
|
126997
|
+
const existingRoot = forEachEntry(
|
|
126998
|
+
buildInfoVersionMap.roots,
|
|
126999
|
+
// File was root file when project was built but its not any more
|
|
127000
|
+
(_resolved, existingRoot2) => !seenRoots.has(existingRoot2) ? existingRoot2 : void 0
|
|
127001
|
+
);
|
|
127002
|
+
if (existingRoot) {
|
|
127003
|
+
return {
|
|
127004
|
+
type: 9 /* OutOfDateRoots */,
|
|
127005
|
+
buildInfoFile: buildInfoPath,
|
|
127006
|
+
inputFile: existingRoot
|
|
127007
|
+
};
|
|
126940
127008
|
}
|
|
126941
127009
|
}
|
|
126942
127010
|
if (!buildInfoPath) {
|
|
@@ -129031,7 +129099,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
129031
129099
|
expression,
|
|
129032
129100
|
/*includeBigInt*/
|
|
129033
129101
|
false
|
|
129034
|
-
)
|
|
129102
|
+
)) {
|
|
129035
129103
|
context.tracker.reportInferenceFallback(prop.name);
|
|
129036
129104
|
result = false;
|
|
129037
129105
|
}
|
|
@@ -129045,21 +129113,6 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
129045
129113
|
for (const prop of objectLiteral.properties) {
|
|
129046
129114
|
Debug.assert(!isShorthandPropertyAssignment(prop) && !isSpreadAssignment(prop));
|
|
129047
129115
|
const name = prop.name;
|
|
129048
|
-
if (prop.name.kind === 167 /* ComputedPropertyName */) {
|
|
129049
|
-
if (!resolver.isNonNarrowedBindableName(prop.name)) {
|
|
129050
|
-
context.tracker.reportInferenceFallback(prop.name);
|
|
129051
|
-
} else if (isEntityNameExpression(prop.name.expression)) {
|
|
129052
|
-
const visibilityResult = resolver.isEntityNameVisible(
|
|
129053
|
-
prop.name.expression,
|
|
129054
|
-
context.enclosingDeclaration,
|
|
129055
|
-
/*shouldComputeAliasToMakeVisible*/
|
|
129056
|
-
false
|
|
129057
|
-
);
|
|
129058
|
-
if (visibilityResult.accessibility !== 0 /* Accessible */) {
|
|
129059
|
-
context.tracker.reportInferenceFallback(prop.name);
|
|
129060
|
-
}
|
|
129061
|
-
}
|
|
129062
|
-
}
|
|
129063
129116
|
switch (prop.kind) {
|
|
129064
129117
|
case 174 /* MethodDeclaration */:
|
|
129065
129118
|
canInferObjectLiteral = !!typeFromObjectLiteralMethod(prop, name, context) && canInferObjectLiteral;
|