@typescript-deploys/pr-build 5.5.0-pr-58028-14 → 5.5.0-pr-58065-2
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/tsc.js +192 -149
- package/lib/typescript.d.ts +0 -56
- package/lib/typescript.js +203 -150
- package/package.json +2 -3
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.20240403`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7369,7 +7369,6 @@ var Diagnostics = {
|
|
|
7369
7369
|
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."),
|
|
7370
7370
|
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'."),
|
|
7371
7371
|
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."),
|
|
7372
|
-
Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks: diag(6805, 3 /* Message */, "Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks_6805", "Default type arguments to parameter's constraint or 'unknown' instead of 'any' for instance checks."),
|
|
7373
7372
|
one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
|
|
7374
7373
|
one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
|
|
7375
7374
|
type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
|
|
@@ -16597,12 +16596,6 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
16597
16596
|
computeValue: (compilerOptions) => {
|
|
16598
16597
|
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
16599
16598
|
}
|
|
16600
|
-
},
|
|
16601
|
-
strictInstanceOfTypeParameters: {
|
|
16602
|
-
dependencies: ["strict"],
|
|
16603
|
-
computeValue: (compilerOptions) => {
|
|
16604
|
-
return getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
|
|
16605
|
-
}
|
|
16606
16599
|
}
|
|
16607
16600
|
});
|
|
16608
16601
|
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
@@ -34569,16 +34562,6 @@ var commandOptionsWithoutBuild = [
|
|
|
34569
34562
|
description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
34570
34563
|
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
34571
34564
|
},
|
|
34572
|
-
{
|
|
34573
|
-
name: "strictInstanceOfTypeParameters",
|
|
34574
|
-
type: "boolean",
|
|
34575
|
-
affectsSemanticDiagnostics: true,
|
|
34576
|
-
affectsBuildInfo: true,
|
|
34577
|
-
strictFlag: true,
|
|
34578
|
-
category: Diagnostics.Type_Checking,
|
|
34579
|
-
description: Diagnostics.Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks,
|
|
34580
|
-
defaultValueDescription: false
|
|
34581
|
-
},
|
|
34582
34565
|
{
|
|
34583
34566
|
name: "noImplicitThis",
|
|
34584
34567
|
type: "boolean",
|
|
@@ -43519,7 +43502,6 @@ function createTypeChecker(host) {
|
|
|
43519
43502
|
var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
43520
43503
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
43521
43504
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
43522
|
-
var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
|
|
43523
43505
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
43524
43506
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
43525
43507
|
var emitResolver = createResolver();
|
|
@@ -49128,68 +49110,7 @@ function createTypeChecker(host) {
|
|
|
49128
49110
|
/*skipUnionExpanding*/
|
|
49129
49111
|
true
|
|
49130
49112
|
)[0];
|
|
49131
|
-
|
|
49132
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && (some(expandedParams) || some(signature.typeParameters))) {
|
|
49133
|
-
let pushFakeScope2 = function(kind2, addAll) {
|
|
49134
|
-
Debug.assert(context.enclosingDeclaration);
|
|
49135
|
-
let existingFakeScope;
|
|
49136
|
-
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) {
|
|
49137
|
-
existingFakeScope = context.enclosingDeclaration;
|
|
49138
|
-
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) {
|
|
49139
|
-
existingFakeScope = context.enclosingDeclaration.parent;
|
|
49140
|
-
}
|
|
49141
|
-
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
49142
|
-
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
49143
|
-
let newLocals;
|
|
49144
|
-
addAll((name, symbol) => {
|
|
49145
|
-
if (!locals.has(name)) {
|
|
49146
|
-
newLocals = append(newLocals, name);
|
|
49147
|
-
locals.set(name, symbol);
|
|
49148
|
-
}
|
|
49149
|
-
});
|
|
49150
|
-
if (!newLocals)
|
|
49151
|
-
return;
|
|
49152
|
-
const oldCleanup = cleanup;
|
|
49153
|
-
function undo() {
|
|
49154
|
-
forEach(newLocals, (s) => locals.delete(s));
|
|
49155
|
-
oldCleanup == null ? void 0 : oldCleanup();
|
|
49156
|
-
}
|
|
49157
|
-
if (existingFakeScope) {
|
|
49158
|
-
cleanup = undo;
|
|
49159
|
-
} else {
|
|
49160
|
-
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
49161
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2;
|
|
49162
|
-
fakeScope.locals = locals;
|
|
49163
|
-
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
49164
|
-
setParent(fakeScope, saveEnclosingDeclaration);
|
|
49165
|
-
context.enclosingDeclaration = fakeScope;
|
|
49166
|
-
cleanup = () => {
|
|
49167
|
-
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
49168
|
-
undo();
|
|
49169
|
-
};
|
|
49170
|
-
}
|
|
49171
|
-
};
|
|
49172
|
-
var pushFakeScope = pushFakeScope2;
|
|
49173
|
-
pushFakeScope2(
|
|
49174
|
-
"params",
|
|
49175
|
-
(add) => {
|
|
49176
|
-
for (const param of expandedParams) {
|
|
49177
|
-
add(param.escapedName, param);
|
|
49178
|
-
}
|
|
49179
|
-
}
|
|
49180
|
-
);
|
|
49181
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
49182
|
-
pushFakeScope2(
|
|
49183
|
-
"typeParams",
|
|
49184
|
-
(add) => {
|
|
49185
|
-
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
49186
|
-
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
49187
|
-
add(typeParamName, typeParam.symbol);
|
|
49188
|
-
}
|
|
49189
|
-
}
|
|
49190
|
-
);
|
|
49191
|
-
}
|
|
49192
|
-
}
|
|
49113
|
+
const cleanup = enterNewScope(context, signature.declaration, expandedParams, signature.typeParameters);
|
|
49193
49114
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */));
|
|
49194
49115
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
49195
49116
|
if (thisParameter) {
|
|
@@ -49280,6 +49201,111 @@ function createTypeChecker(host) {
|
|
|
49280
49201
|
cleanup == null ? void 0 : cleanup();
|
|
49281
49202
|
return node;
|
|
49282
49203
|
}
|
|
49204
|
+
function isNewScopeNode(node) {
|
|
49205
|
+
return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
|
|
49206
|
+
}
|
|
49207
|
+
function getTypeParametersInScope(node) {
|
|
49208
|
+
return isFunctionLike(node) || isJSDocSignature(node) ? getSignatureFromDeclaration(node).typeParameters : isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
|
|
49209
|
+
}
|
|
49210
|
+
function getParametersInScope(node) {
|
|
49211
|
+
return isFunctionLike(node) || isJSDocSignature(node) ? getExpandedParameters(
|
|
49212
|
+
getSignatureFromDeclaration(node),
|
|
49213
|
+
/*skipUnionExpanding*/
|
|
49214
|
+
true
|
|
49215
|
+
)[0] : void 0;
|
|
49216
|
+
}
|
|
49217
|
+
function enterNewScope(context, declaration, expandedParams, typeParameters) {
|
|
49218
|
+
let cleanup;
|
|
49219
|
+
if (context.enclosingDeclaration && declaration && declaration !== context.enclosingDeclaration && !isInJSFile(declaration) && (some(expandedParams) || some(typeParameters))) {
|
|
49220
|
+
let pushFakeScope2 = function(kind, addAll) {
|
|
49221
|
+
Debug.assert(context.enclosingDeclaration);
|
|
49222
|
+
let existingFakeScope;
|
|
49223
|
+
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind) {
|
|
49224
|
+
existingFakeScope = context.enclosingDeclaration;
|
|
49225
|
+
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind) {
|
|
49226
|
+
existingFakeScope = context.enclosingDeclaration.parent;
|
|
49227
|
+
}
|
|
49228
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
49229
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
49230
|
+
let newLocals;
|
|
49231
|
+
addAll((name, symbol) => {
|
|
49232
|
+
if (!locals.has(name)) {
|
|
49233
|
+
newLocals = append(newLocals, name);
|
|
49234
|
+
locals.set(name, symbol);
|
|
49235
|
+
}
|
|
49236
|
+
});
|
|
49237
|
+
if (!newLocals)
|
|
49238
|
+
return;
|
|
49239
|
+
const oldCleanup = cleanup;
|
|
49240
|
+
function undo() {
|
|
49241
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
49242
|
+
oldCleanup == null ? void 0 : oldCleanup();
|
|
49243
|
+
}
|
|
49244
|
+
if (existingFakeScope) {
|
|
49245
|
+
cleanup = undo;
|
|
49246
|
+
} else {
|
|
49247
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
49248
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind;
|
|
49249
|
+
fakeScope.locals = locals;
|
|
49250
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
49251
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
49252
|
+
context.enclosingDeclaration = fakeScope;
|
|
49253
|
+
cleanup = () => {
|
|
49254
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
49255
|
+
undo();
|
|
49256
|
+
};
|
|
49257
|
+
}
|
|
49258
|
+
};
|
|
49259
|
+
var pushFakeScope = pushFakeScope2;
|
|
49260
|
+
pushFakeScope2(
|
|
49261
|
+
"params",
|
|
49262
|
+
(add) => {
|
|
49263
|
+
for (const param of expandedParams ?? emptyArray) {
|
|
49264
|
+
if (!forEach(param.declarations, (d) => {
|
|
49265
|
+
if (isParameter(d) && isBindingPattern(d.name)) {
|
|
49266
|
+
bindPattern(d.name);
|
|
49267
|
+
return true;
|
|
49268
|
+
}
|
|
49269
|
+
return void 0;
|
|
49270
|
+
function bindPattern(p) {
|
|
49271
|
+
forEach(p.elements, (e) => {
|
|
49272
|
+
switch (e.kind) {
|
|
49273
|
+
case 232 /* OmittedExpression */:
|
|
49274
|
+
return;
|
|
49275
|
+
case 208 /* BindingElement */:
|
|
49276
|
+
return bindElement(e);
|
|
49277
|
+
default:
|
|
49278
|
+
return Debug.assertNever(e);
|
|
49279
|
+
}
|
|
49280
|
+
});
|
|
49281
|
+
}
|
|
49282
|
+
function bindElement(e) {
|
|
49283
|
+
if (isBindingPattern(e.name)) {
|
|
49284
|
+
return bindPattern(e.name);
|
|
49285
|
+
}
|
|
49286
|
+
const symbol = getSymbolOfDeclaration(e);
|
|
49287
|
+
add(symbol.escapedName, symbol);
|
|
49288
|
+
}
|
|
49289
|
+
})) {
|
|
49290
|
+
add(param.escapedName, param);
|
|
49291
|
+
}
|
|
49292
|
+
}
|
|
49293
|
+
}
|
|
49294
|
+
);
|
|
49295
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
49296
|
+
pushFakeScope2(
|
|
49297
|
+
"typeParams",
|
|
49298
|
+
(add) => {
|
|
49299
|
+
for (const typeParam of typeParameters ?? emptyArray) {
|
|
49300
|
+
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
49301
|
+
add(typeParamName, typeParam.symbol);
|
|
49302
|
+
}
|
|
49303
|
+
}
|
|
49304
|
+
);
|
|
49305
|
+
}
|
|
49306
|
+
return cleanup;
|
|
49307
|
+
}
|
|
49308
|
+
}
|
|
49283
49309
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
49284
49310
|
if (signature.thisParameter) {
|
|
49285
49311
|
return symbolToParameterDeclaration(signature.thisParameter, context);
|
|
@@ -49898,6 +49924,9 @@ function createTypeChecker(host) {
|
|
|
49898
49924
|
if (initial.typeParameterSymbolList) {
|
|
49899
49925
|
initial.typeParameterSymbolList = new Set(initial.typeParameterSymbolList);
|
|
49900
49926
|
}
|
|
49927
|
+
if (initial.typeParameterNamesByTextNextNameCount) {
|
|
49928
|
+
initial.typeParameterNamesByTextNextNameCount = new Map(initial.typeParameterNamesByTextNextNameCount);
|
|
49929
|
+
}
|
|
49901
49930
|
initial.tracker = new SymbolTrackerImpl(initial, initial.tracker.inner, initial.tracker.moduleResolverHost);
|
|
49902
49931
|
return initial;
|
|
49903
49932
|
}
|
|
@@ -50030,6 +50059,22 @@ function createTypeChecker(host) {
|
|
|
50030
50059
|
}
|
|
50031
50060
|
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
|
|
50032
50061
|
function visitExistingNodeTreeSymbols(node) {
|
|
50062
|
+
const onExitNewScope = isNewScopeNode(node) ? onEnterNewScope(node) : void 0;
|
|
50063
|
+
const result = visitExistingNodeTreeSymbolsWorker(node);
|
|
50064
|
+
onExitNewScope == null ? void 0 : onExitNewScope();
|
|
50065
|
+
return result;
|
|
50066
|
+
}
|
|
50067
|
+
function onEnterNewScope(node) {
|
|
50068
|
+
const oldContex = context;
|
|
50069
|
+
context = cloneNodeBuilderContext(context);
|
|
50070
|
+
const cleanup = enterNewScope(context, node, getParametersInScope(node), getTypeParametersInScope(node));
|
|
50071
|
+
return onExitNewScope;
|
|
50072
|
+
function onExitNewScope() {
|
|
50073
|
+
cleanup == null ? void 0 : cleanup();
|
|
50074
|
+
context = oldContex;
|
|
50075
|
+
}
|
|
50076
|
+
}
|
|
50077
|
+
function visitExistingNodeTreeSymbolsWorker(node) {
|
|
50033
50078
|
if (isJSDocAllType(node) || node.kind === 319 /* JSDocNamepathType */) {
|
|
50034
50079
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50035
50080
|
}
|
|
@@ -50180,6 +50225,21 @@ function createTypeChecker(host) {
|
|
|
50180
50225
|
setEmitFlags(clone, flags | (context.flags & 1024 /* MultilineObjectLiterals */ && isTypeLiteralNode(node) ? 0 : 1 /* SingleLine */));
|
|
50181
50226
|
return clone;
|
|
50182
50227
|
}
|
|
50228
|
+
if (isConditionalTypeNode(node)) {
|
|
50229
|
+
const checkType = visitNode(node.checkType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
50230
|
+
const disposeScope = onEnterNewScope(node);
|
|
50231
|
+
const extendType = visitNode(node.extendsType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
50232
|
+
const trueType2 = visitNode(node.trueType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
50233
|
+
disposeScope();
|
|
50234
|
+
const falseType2 = visitNode(node.falseType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
50235
|
+
return factory.updateConditionalTypeNode(
|
|
50236
|
+
node,
|
|
50237
|
+
checkType,
|
|
50238
|
+
extendType,
|
|
50239
|
+
trueType2,
|
|
50240
|
+
falseType2
|
|
50241
|
+
);
|
|
50242
|
+
}
|
|
50183
50243
|
return visitEachChild(
|
|
50184
50244
|
node,
|
|
50185
50245
|
visitExistingNodeTreeSymbols,
|
|
@@ -52051,32 +52111,9 @@ function createTypeChecker(host) {
|
|
|
52051
52111
|
}
|
|
52052
52112
|
}).parent;
|
|
52053
52113
|
}
|
|
52054
|
-
function getInstanceTypeOfClassSymbol(classSymbol) {
|
|
52055
|
-
const classType = getDeclaredTypeOfSymbol(classSymbol);
|
|
52056
|
-
const objectFlags = getObjectFlags(classType);
|
|
52057
|
-
if (!(objectFlags & 3 /* ClassOrInterface */) || !classType.typeParameters) {
|
|
52058
|
-
return classType;
|
|
52059
|
-
}
|
|
52060
|
-
const variances = getVariances(classType);
|
|
52061
|
-
const isJs = some(classSymbol.declarations, isInJSFile);
|
|
52062
|
-
const inferredTypes = calculateInferredTypeArguments(classType.typeParameters, isJs);
|
|
52063
|
-
const typeArguments = map(inferredTypes, (inferredType, i) => {
|
|
52064
|
-
if (!strictInstanceOfTypeParameters) {
|
|
52065
|
-
return anyType;
|
|
52066
|
-
}
|
|
52067
|
-
const variance = variances[i];
|
|
52068
|
-
switch (variance & 7 /* VarianceMask */) {
|
|
52069
|
-
case 2 /* Contravariant */:
|
|
52070
|
-
case 3 /* Bivariant */:
|
|
52071
|
-
return neverType;
|
|
52072
|
-
}
|
|
52073
|
-
return inferredType || unknownType;
|
|
52074
|
-
});
|
|
52075
|
-
return createTypeReference(classType, typeArguments);
|
|
52076
|
-
}
|
|
52077
52114
|
function getTypeOfPrototypeProperty(prototype) {
|
|
52078
|
-
const
|
|
52079
|
-
return
|
|
52115
|
+
const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
|
|
52116
|
+
return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, (_) => anyType)) : classType;
|
|
52080
52117
|
}
|
|
52081
52118
|
function getTypeOfPropertyOfType(type, name) {
|
|
52082
52119
|
const prop = getPropertyOfType(type, name);
|
|
@@ -55777,26 +55814,6 @@ function createTypeChecker(host) {
|
|
|
55777
55814
|
}
|
|
55778
55815
|
return typeArguments && typeArguments.slice();
|
|
55779
55816
|
}
|
|
55780
|
-
function calculateInferredTypeArguments(typeParameters, isJavaScriptImplicitAny) {
|
|
55781
|
-
const numTypeParameters = length(typeParameters);
|
|
55782
|
-
if (!numTypeParameters) {
|
|
55783
|
-
return [];
|
|
55784
|
-
}
|
|
55785
|
-
const result = [];
|
|
55786
|
-
for (let i = 0; i < numTypeParameters; i++) {
|
|
55787
|
-
result[i] = errorType;
|
|
55788
|
-
}
|
|
55789
|
-
const baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny);
|
|
55790
|
-
for (let i = 0; i < numTypeParameters; i++) {
|
|
55791
|
-
let inferredType = getBaseConstraintOfType(typeParameters[i]);
|
|
55792
|
-
if (isJavaScriptImplicitAny && inferredType && (isTypeIdenticalTo(inferredType, unknownType) || isTypeIdenticalTo(inferredType, emptyObjectType))) {
|
|
55793
|
-
inferredType = anyType;
|
|
55794
|
-
}
|
|
55795
|
-
result[i] = inferredType ? instantiateType(inferredType, createTypeMapper(typeParameters, result)) : baseDefaultType;
|
|
55796
|
-
}
|
|
55797
|
-
result.length = typeParameters.length;
|
|
55798
|
-
return result;
|
|
55799
|
-
}
|
|
55800
55817
|
function getSignatureFromDeclaration(declaration) {
|
|
55801
55818
|
const links = getNodeLinks(declaration);
|
|
55802
55819
|
if (!links.resolvedSignature) {
|
|
@@ -67106,8 +67123,8 @@ function createTypeChecker(host) {
|
|
|
67106
67123
|
if (symbol === void 0) {
|
|
67107
67124
|
return type;
|
|
67108
67125
|
}
|
|
67109
|
-
const classSymbol =
|
|
67110
|
-
const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) :
|
|
67126
|
+
const classSymbol = symbol.parent;
|
|
67127
|
+
const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol);
|
|
67111
67128
|
return getNarrowedType(
|
|
67112
67129
|
type,
|
|
67113
67130
|
targetType,
|
|
@@ -74564,17 +74581,18 @@ function createTypeChecker(host) {
|
|
|
74564
74581
|
const antecedent = expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || { flags: 2 /* Start */ };
|
|
74565
74582
|
const trueCondition = {
|
|
74566
74583
|
flags: 32 /* TrueCondition */,
|
|
74567
|
-
|
|
74568
|
-
|
|
74584
|
+
antecedent,
|
|
74585
|
+
node: expr
|
|
74569
74586
|
};
|
|
74570
74587
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
|
74571
74588
|
if (trueType2 === initType)
|
|
74572
74589
|
return void 0;
|
|
74573
74590
|
const falseCondition = {
|
|
74574
|
-
|
|
74575
|
-
|
|
74591
|
+
flags: 64 /* FalseCondition */,
|
|
74592
|
+
antecedent,
|
|
74593
|
+
node: expr
|
|
74576
74594
|
};
|
|
74577
|
-
const falseSubtype = getFlowTypeOfReference(param.name,
|
|
74595
|
+
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
74578
74596
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
74579
74597
|
}
|
|
74580
74598
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
@@ -117196,6 +117214,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117196
117214
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
|
117197
117215
|
isSourceOfProjectReferenceRedirect,
|
|
117198
117216
|
getRedirectReferenceForResolutionFromSourceOfProject,
|
|
117217
|
+
getRedirectReferenceForResolution,
|
|
117199
117218
|
emitBuildInfo,
|
|
117200
117219
|
fileExists,
|
|
117201
117220
|
readFile,
|
|
@@ -122111,7 +122130,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122111
122130
|
getResolutionWithResolvedFileName,
|
|
122112
122131
|
deferWatchingNonRelativeResolution,
|
|
122113
122132
|
shouldRetryResolution,
|
|
122114
|
-
logChanges
|
|
122133
|
+
logChanges,
|
|
122134
|
+
canWatchFailedLookups
|
|
122115
122135
|
}) {
|
|
122116
122136
|
const path = resolutionHost.toPath(containingFile);
|
|
122117
122137
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
@@ -122134,7 +122154,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122134
122154
|
}
|
|
122135
122155
|
resolutionsInFile.set(name, mode, resolution);
|
|
122136
122156
|
if (resolution !== existingResolution) {
|
|
122137
|
-
watchFailedLookupLocationsOfExternalModuleResolutions(
|
|
122157
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(
|
|
122158
|
+
name,
|
|
122159
|
+
resolution,
|
|
122160
|
+
path,
|
|
122161
|
+
getResolutionWithResolvedFileName,
|
|
122162
|
+
deferWatchingNonRelativeResolution,
|
|
122163
|
+
(resolution2) => canWatchFailedLookups(resolution2, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options, containingSourceFile)
|
|
122164
|
+
);
|
|
122138
122165
|
if (existingResolution) {
|
|
122139
122166
|
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
122140
122167
|
}
|
|
@@ -122213,7 +122240,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122213
122240
|
),
|
|
122214
122241
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
122215
122242
|
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
|
|
122216
|
-
deferWatchingNonRelativeResolution: false
|
|
122243
|
+
deferWatchingNonRelativeResolution: false,
|
|
122244
|
+
canWatchFailedLookups: canWatchFailedLookupsOfTypeReferencedDirective
|
|
122217
122245
|
});
|
|
122218
122246
|
}
|
|
122219
122247
|
function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
@@ -122235,8 +122263,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122235
122263
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
122236
122264
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
122237
122265
|
logChanges: logChangesWhenResolvingModule,
|
|
122238
|
-
deferWatchingNonRelativeResolution: true
|
|
122266
|
+
deferWatchingNonRelativeResolution: true,
|
|
122239
122267
|
// Defer non relative resolution watch because we could be using ambient modules
|
|
122268
|
+
canWatchFailedLookups: canWatchFailedLookupsOfResolvedModule
|
|
122240
122269
|
});
|
|
122241
122270
|
}
|
|
122242
122271
|
function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
|
|
@@ -122252,7 +122281,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122252
122281
|
path,
|
|
122253
122282
|
getResolvedModule,
|
|
122254
122283
|
/*deferWatchingNonRelativeResolution*/
|
|
122255
|
-
false
|
|
122284
|
+
false,
|
|
122285
|
+
canWatchFailedLookupsOfResolvedLibrary
|
|
122256
122286
|
);
|
|
122257
122287
|
resolvedLibraries.set(libFileName, resolution);
|
|
122258
122288
|
if (existingResolution) {
|
|
@@ -122299,16 +122329,18 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122299
122329
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
122300
122330
|
return endsWith(dirPath, "/node_modules/@types");
|
|
122301
122331
|
}
|
|
122302
|
-
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
|
|
122303
|
-
var _a;
|
|
122332
|
+
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution, canWatchFailedLookups) {
|
|
122333
|
+
var _a, _b;
|
|
122304
122334
|
if (resolution.refCount) {
|
|
122305
122335
|
resolution.refCount++;
|
|
122306
122336
|
Debug.assertIsDefined(resolution.files);
|
|
122307
122337
|
} else {
|
|
122308
122338
|
resolution.refCount = 1;
|
|
122309
122339
|
Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
|
|
122340
|
+
if (((_b = resolution.failedLookupLocations) == null ? void 0 : _b.length) && canWatchFailedLookups(resolution))
|
|
122341
|
+
resolution.canWatchFailedLookups = true;
|
|
122310
122342
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
122311
|
-
|
|
122343
|
+
watchFailedLookupLocationAndAffectedLocationsOfResolution(resolution);
|
|
122312
122344
|
} else {
|
|
122313
122345
|
nonRelativeExternalModuleResolutions.add(name, resolution);
|
|
122314
122346
|
}
|
|
@@ -122344,15 +122376,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122344
122376
|
}
|
|
122345
122377
|
return setAtRoot;
|
|
122346
122378
|
}
|
|
122347
|
-
function
|
|
122379
|
+
function watchFailedLookupLocationAndAffectedLocationsOfResolution(resolution) {
|
|
122348
122380
|
Debug.assert(!!resolution.refCount);
|
|
122349
122381
|
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
122350
122382
|
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult)
|
|
122351
122383
|
return;
|
|
122352
|
-
|
|
122384
|
+
const addToFailedLookup = resolution.canWatchFailedLookups || alternateResult;
|
|
122385
|
+
if (addToFailedLookup)
|
|
122353
122386
|
resolutionsWithFailedLookups.add(resolution);
|
|
122354
122387
|
let setAtRoot = false;
|
|
122355
|
-
if (
|
|
122388
|
+
if (resolution.canWatchFailedLookups) {
|
|
122356
122389
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
122357
122390
|
setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot);
|
|
122358
122391
|
}
|
|
@@ -122367,7 +122400,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122367
122400
|
true
|
|
122368
122401
|
);
|
|
122369
122402
|
}
|
|
122370
|
-
watchAffectingLocationsOfResolution(resolution, !
|
|
122403
|
+
watchAffectingLocationsOfResolution(resolution, !addToFailedLookup);
|
|
122371
122404
|
}
|
|
122372
122405
|
function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
|
|
122373
122406
|
Debug.assert(!!resolution.refCount);
|
|
@@ -122454,7 +122487,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122454
122487
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
122455
122488
|
const program = resolutionHost.getCurrentProgram();
|
|
122456
122489
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
122457
|
-
resolutions.forEach(
|
|
122490
|
+
resolutions.forEach(watchFailedLookupLocationAndAffectedLocationsOfResolution);
|
|
122458
122491
|
} else {
|
|
122459
122492
|
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
122460
122493
|
resolution,
|
|
@@ -122505,10 +122538,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122505
122538
|
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
122506
122539
|
resolvedFileToResolution.delete(key);
|
|
122507
122540
|
}
|
|
122508
|
-
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
122541
|
+
const { canWatchFailedLookups, failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
122509
122542
|
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
122510
122543
|
let removeAtRoot = false;
|
|
122511
|
-
if (
|
|
122544
|
+
if (canWatchFailedLookups) {
|
|
122512
122545
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
122513
122546
|
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
122514
122547
|
}
|
|
@@ -122681,7 +122714,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122681
122714
|
return true;
|
|
122682
122715
|
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
|
|
122683
122716
|
return false;
|
|
122684
|
-
return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
|
|
122717
|
+
return resolution.canWatchFailedLookups && ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
|
|
122685
122718
|
}
|
|
122686
122719
|
function isInvalidatedFailedLookup(locationPath) {
|
|
122687
122720
|
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);
|
|
@@ -122744,6 +122777,16 @@ function resolutionIsSymlink(resolution) {
|
|
|
122744
122777
|
var _a, _b;
|
|
122745
122778
|
return !!(((_a = resolution.resolvedModule) == null ? void 0 : _a.originalPath) || ((_b = resolution.resolvedTypeReferenceDirective) == null ? void 0 : _b.originalPath));
|
|
122746
122779
|
}
|
|
122780
|
+
function canWatchFailedLookupsOfResolvedModule(resolution, optionsForFile, file) {
|
|
122781
|
+
var _a;
|
|
122782
|
+
return !resolution.resolvedModule || !!resolution.alternateResult || !!((_a = resolution.resolutionDiagnostics) == null ? void 0 : _a.length) || !!getResolutionDiagnostic(optionsForFile, resolution.resolvedModule, file);
|
|
122783
|
+
}
|
|
122784
|
+
function canWatchFailedLookupsOfTypeReferencedDirective(resolution) {
|
|
122785
|
+
return !resolution.resolvedTypeReferenceDirective;
|
|
122786
|
+
}
|
|
122787
|
+
function canWatchFailedLookupsOfResolvedLibrary(resolution) {
|
|
122788
|
+
return !resolution.resolvedModule;
|
|
122789
|
+
}
|
|
122747
122790
|
|
|
122748
122791
|
// src/compiler/watch.ts
|
|
122749
122792
|
var sysFormatDiagnosticsHost = sys ? {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -5793,61 +5793,6 @@ declare namespace ts {
|
|
|
5793
5793
|
readonly moduleSpecifier: Expression;
|
|
5794
5794
|
readonly attributes?: ImportAttributes;
|
|
5795
5795
|
}
|
|
5796
|
-
enum FlowFlags {
|
|
5797
|
-
Unreachable = 1,
|
|
5798
|
-
Start = 2,
|
|
5799
|
-
BranchLabel = 4,
|
|
5800
|
-
LoopLabel = 8,
|
|
5801
|
-
Assignment = 16,
|
|
5802
|
-
TrueCondition = 32,
|
|
5803
|
-
FalseCondition = 64,
|
|
5804
|
-
SwitchClause = 128,
|
|
5805
|
-
ArrayMutation = 256,
|
|
5806
|
-
Call = 512,
|
|
5807
|
-
ReduceLabel = 1024,
|
|
5808
|
-
Referenced = 2048,
|
|
5809
|
-
Shared = 4096,
|
|
5810
|
-
Label = 12,
|
|
5811
|
-
Condition = 96,
|
|
5812
|
-
}
|
|
5813
|
-
type FlowNode = FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation | FlowCall | FlowReduceLabel;
|
|
5814
|
-
interface FlowNodeBase {
|
|
5815
|
-
flags: FlowFlags;
|
|
5816
|
-
id?: number;
|
|
5817
|
-
}
|
|
5818
|
-
interface FlowStart extends FlowNodeBase {
|
|
5819
|
-
node?: FunctionExpression | ArrowFunction | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration;
|
|
5820
|
-
}
|
|
5821
|
-
interface FlowLabel extends FlowNodeBase {
|
|
5822
|
-
antecedents: FlowNode[] | undefined;
|
|
5823
|
-
}
|
|
5824
|
-
interface FlowAssignment extends FlowNodeBase {
|
|
5825
|
-
node: Expression | VariableDeclaration | BindingElement;
|
|
5826
|
-
antecedent: FlowNode;
|
|
5827
|
-
}
|
|
5828
|
-
interface FlowCall extends FlowNodeBase {
|
|
5829
|
-
node: CallExpression;
|
|
5830
|
-
antecedent: FlowNode;
|
|
5831
|
-
}
|
|
5832
|
-
interface FlowCondition extends FlowNodeBase {
|
|
5833
|
-
node: Expression;
|
|
5834
|
-
antecedent: FlowNode;
|
|
5835
|
-
}
|
|
5836
|
-
interface FlowSwitchClause extends FlowNodeBase {
|
|
5837
|
-
switchStatement: SwitchStatement;
|
|
5838
|
-
clauseStart: number;
|
|
5839
|
-
clauseEnd: number;
|
|
5840
|
-
antecedent: FlowNode;
|
|
5841
|
-
}
|
|
5842
|
-
interface FlowArrayMutation extends FlowNodeBase {
|
|
5843
|
-
node: CallExpression | BinaryExpression;
|
|
5844
|
-
antecedent: FlowNode;
|
|
5845
|
-
}
|
|
5846
|
-
interface FlowReduceLabel extends FlowNodeBase {
|
|
5847
|
-
target: FlowLabel;
|
|
5848
|
-
antecedents: FlowNode[];
|
|
5849
|
-
antecedent: FlowNode;
|
|
5850
|
-
}
|
|
5851
5796
|
type FlowType = Type | IncompleteType;
|
|
5852
5797
|
interface IncompleteType {
|
|
5853
5798
|
flags: TypeFlags | 0;
|
|
@@ -6979,7 +6924,6 @@ declare namespace ts {
|
|
|
6979
6924
|
strictBindCallApply?: boolean;
|
|
6980
6925
|
strictNullChecks?: boolean;
|
|
6981
6926
|
strictPropertyInitialization?: boolean;
|
|
6982
|
-
strictInstanceOfTypeParameters?: boolean;
|
|
6983
6927
|
stripInternal?: boolean;
|
|
6984
6928
|
/** @deprecated */
|
|
6985
6929
|
suppressExcessPropertyErrors?: boolean;
|
package/lib/typescript.js
CHANGED
|
@@ -262,6 +262,9 @@ __export(typescript_exports, {
|
|
|
262
262
|
canWatchAffectingLocation: () => canWatchAffectingLocation,
|
|
263
263
|
canWatchAtTypes: () => canWatchAtTypes,
|
|
264
264
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
265
|
+
canWatchFailedLookupsOfResolvedLibrary: () => canWatchFailedLookupsOfResolvedLibrary,
|
|
266
|
+
canWatchFailedLookupsOfResolvedModule: () => canWatchFailedLookupsOfResolvedModule,
|
|
267
|
+
canWatchFailedLookupsOfTypeReferencedDirective: () => canWatchFailedLookupsOfTypeReferencedDirective,
|
|
265
268
|
cartesianProduct: () => cartesianProduct,
|
|
266
269
|
cast: () => cast,
|
|
267
270
|
chainBundle: () => chainBundle,
|
|
@@ -2328,7 +2331,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2328
2331
|
|
|
2329
2332
|
// src/compiler/corePublic.ts
|
|
2330
2333
|
var versionMajorMinor = "5.5";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2334
|
+
var version = `${versionMajorMinor}.0-insiders.20240403`;
|
|
2332
2335
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2336
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2337
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10926,7 +10929,6 @@ var Diagnostics = {
|
|
|
10926
10929
|
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."),
|
|
10927
10930
|
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'."),
|
|
10928
10931
|
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."),
|
|
10929
|
-
Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks: diag(6805, 3 /* Message */, "Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks_6805", "Default type arguments to parameter's constraint or 'unknown' instead of 'any' for instance checks."),
|
|
10930
10932
|
one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
|
|
10931
10933
|
one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
|
|
10932
10934
|
type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
|
|
@@ -20784,12 +20786,6 @@ var computedOptions = createComputedCompilerOptions({
|
|
|
20784
20786
|
computeValue: (compilerOptions) => {
|
|
20785
20787
|
return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
20786
20788
|
}
|
|
20787
|
-
},
|
|
20788
|
-
strictInstanceOfTypeParameters: {
|
|
20789
|
-
dependencies: ["strict"],
|
|
20790
|
-
computeValue: (compilerOptions) => {
|
|
20791
|
-
return getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
|
|
20792
|
-
}
|
|
20793
20789
|
}
|
|
20794
20790
|
});
|
|
20795
20791
|
var getEmitScriptTarget = computedOptions.target.computeValue;
|
|
@@ -38991,16 +38987,6 @@ var commandOptionsWithoutBuild = [
|
|
|
38991
38987
|
description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,
|
|
38992
38988
|
defaultValueDescription: Diagnostics.false_unless_strict_is_set
|
|
38993
38989
|
},
|
|
38994
|
-
{
|
|
38995
|
-
name: "strictInstanceOfTypeParameters",
|
|
38996
|
-
type: "boolean",
|
|
38997
|
-
affectsSemanticDiagnostics: true,
|
|
38998
|
-
affectsBuildInfo: true,
|
|
38999
|
-
strictFlag: true,
|
|
39000
|
-
category: Diagnostics.Type_Checking,
|
|
39001
|
-
description: Diagnostics.Default_type_arguments_to_parameter_s_constraint_or_unknown_instead_of_any_for_instance_checks,
|
|
39002
|
-
defaultValueDescription: false
|
|
39003
|
-
},
|
|
39004
38990
|
{
|
|
39005
38991
|
name: "noImplicitThis",
|
|
39006
38992
|
type: "boolean",
|
|
@@ -48284,7 +48270,6 @@ function createTypeChecker(host) {
|
|
|
48284
48270
|
var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
|
48285
48271
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
48286
48272
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
48287
|
-
var strictInstanceOfTypeParameters = getStrictOptionValue(compilerOptions, "strictInstanceOfTypeParameters");
|
|
48288
48273
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
48289
48274
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
48290
48275
|
var emitResolver = createResolver();
|
|
@@ -53893,68 +53878,7 @@ function createTypeChecker(host) {
|
|
|
53893
53878
|
/*skipUnionExpanding*/
|
|
53894
53879
|
true
|
|
53895
53880
|
)[0];
|
|
53896
|
-
|
|
53897
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && (some(expandedParams) || some(signature.typeParameters))) {
|
|
53898
|
-
let pushFakeScope2 = function(kind2, addAll) {
|
|
53899
|
-
Debug.assert(context.enclosingDeclaration);
|
|
53900
|
-
let existingFakeScope;
|
|
53901
|
-
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) {
|
|
53902
|
-
existingFakeScope = context.enclosingDeclaration;
|
|
53903
|
-
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) {
|
|
53904
|
-
existingFakeScope = context.enclosingDeclaration.parent;
|
|
53905
|
-
}
|
|
53906
|
-
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
53907
|
-
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
53908
|
-
let newLocals;
|
|
53909
|
-
addAll((name, symbol) => {
|
|
53910
|
-
if (!locals.has(name)) {
|
|
53911
|
-
newLocals = append(newLocals, name);
|
|
53912
|
-
locals.set(name, symbol);
|
|
53913
|
-
}
|
|
53914
|
-
});
|
|
53915
|
-
if (!newLocals)
|
|
53916
|
-
return;
|
|
53917
|
-
const oldCleanup = cleanup;
|
|
53918
|
-
function undo() {
|
|
53919
|
-
forEach(newLocals, (s) => locals.delete(s));
|
|
53920
|
-
oldCleanup == null ? void 0 : oldCleanup();
|
|
53921
|
-
}
|
|
53922
|
-
if (existingFakeScope) {
|
|
53923
|
-
cleanup = undo;
|
|
53924
|
-
} else {
|
|
53925
|
-
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
53926
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2;
|
|
53927
|
-
fakeScope.locals = locals;
|
|
53928
|
-
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
53929
|
-
setParent(fakeScope, saveEnclosingDeclaration);
|
|
53930
|
-
context.enclosingDeclaration = fakeScope;
|
|
53931
|
-
cleanup = () => {
|
|
53932
|
-
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
53933
|
-
undo();
|
|
53934
|
-
};
|
|
53935
|
-
}
|
|
53936
|
-
};
|
|
53937
|
-
var pushFakeScope = pushFakeScope2;
|
|
53938
|
-
pushFakeScope2(
|
|
53939
|
-
"params",
|
|
53940
|
-
(add) => {
|
|
53941
|
-
for (const param of expandedParams) {
|
|
53942
|
-
add(param.escapedName, param);
|
|
53943
|
-
}
|
|
53944
|
-
}
|
|
53945
|
-
);
|
|
53946
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
53947
|
-
pushFakeScope2(
|
|
53948
|
-
"typeParams",
|
|
53949
|
-
(add) => {
|
|
53950
|
-
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
53951
|
-
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
53952
|
-
add(typeParamName, typeParam.symbol);
|
|
53953
|
-
}
|
|
53954
|
-
}
|
|
53955
|
-
);
|
|
53956
|
-
}
|
|
53957
|
-
}
|
|
53881
|
+
const cleanup = enterNewScope(context, signature.declaration, expandedParams, signature.typeParameters);
|
|
53958
53882
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */));
|
|
53959
53883
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
53960
53884
|
if (thisParameter) {
|
|
@@ -54045,6 +53969,111 @@ function createTypeChecker(host) {
|
|
|
54045
53969
|
cleanup == null ? void 0 : cleanup();
|
|
54046
53970
|
return node;
|
|
54047
53971
|
}
|
|
53972
|
+
function isNewScopeNode(node) {
|
|
53973
|
+
return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
|
|
53974
|
+
}
|
|
53975
|
+
function getTypeParametersInScope(node) {
|
|
53976
|
+
return isFunctionLike(node) || isJSDocSignature(node) ? getSignatureFromDeclaration(node).typeParameters : isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
|
|
53977
|
+
}
|
|
53978
|
+
function getParametersInScope(node) {
|
|
53979
|
+
return isFunctionLike(node) || isJSDocSignature(node) ? getExpandedParameters(
|
|
53980
|
+
getSignatureFromDeclaration(node),
|
|
53981
|
+
/*skipUnionExpanding*/
|
|
53982
|
+
true
|
|
53983
|
+
)[0] : void 0;
|
|
53984
|
+
}
|
|
53985
|
+
function enterNewScope(context, declaration, expandedParams, typeParameters) {
|
|
53986
|
+
let cleanup;
|
|
53987
|
+
if (context.enclosingDeclaration && declaration && declaration !== context.enclosingDeclaration && !isInJSFile(declaration) && (some(expandedParams) || some(typeParameters))) {
|
|
53988
|
+
let pushFakeScope2 = function(kind, addAll) {
|
|
53989
|
+
Debug.assert(context.enclosingDeclaration);
|
|
53990
|
+
let existingFakeScope;
|
|
53991
|
+
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind) {
|
|
53992
|
+
existingFakeScope = context.enclosingDeclaration;
|
|
53993
|
+
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind) {
|
|
53994
|
+
existingFakeScope = context.enclosingDeclaration.parent;
|
|
53995
|
+
}
|
|
53996
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
53997
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
53998
|
+
let newLocals;
|
|
53999
|
+
addAll((name, symbol) => {
|
|
54000
|
+
if (!locals.has(name)) {
|
|
54001
|
+
newLocals = append(newLocals, name);
|
|
54002
|
+
locals.set(name, symbol);
|
|
54003
|
+
}
|
|
54004
|
+
});
|
|
54005
|
+
if (!newLocals)
|
|
54006
|
+
return;
|
|
54007
|
+
const oldCleanup = cleanup;
|
|
54008
|
+
function undo() {
|
|
54009
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
54010
|
+
oldCleanup == null ? void 0 : oldCleanup();
|
|
54011
|
+
}
|
|
54012
|
+
if (existingFakeScope) {
|
|
54013
|
+
cleanup = undo;
|
|
54014
|
+
} else {
|
|
54015
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
54016
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind;
|
|
54017
|
+
fakeScope.locals = locals;
|
|
54018
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
54019
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
54020
|
+
context.enclosingDeclaration = fakeScope;
|
|
54021
|
+
cleanup = () => {
|
|
54022
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
54023
|
+
undo();
|
|
54024
|
+
};
|
|
54025
|
+
}
|
|
54026
|
+
};
|
|
54027
|
+
var pushFakeScope = pushFakeScope2;
|
|
54028
|
+
pushFakeScope2(
|
|
54029
|
+
"params",
|
|
54030
|
+
(add) => {
|
|
54031
|
+
for (const param of expandedParams ?? emptyArray) {
|
|
54032
|
+
if (!forEach(param.declarations, (d) => {
|
|
54033
|
+
if (isParameter(d) && isBindingPattern(d.name)) {
|
|
54034
|
+
bindPattern(d.name);
|
|
54035
|
+
return true;
|
|
54036
|
+
}
|
|
54037
|
+
return void 0;
|
|
54038
|
+
function bindPattern(p) {
|
|
54039
|
+
forEach(p.elements, (e) => {
|
|
54040
|
+
switch (e.kind) {
|
|
54041
|
+
case 232 /* OmittedExpression */:
|
|
54042
|
+
return;
|
|
54043
|
+
case 208 /* BindingElement */:
|
|
54044
|
+
return bindElement(e);
|
|
54045
|
+
default:
|
|
54046
|
+
return Debug.assertNever(e);
|
|
54047
|
+
}
|
|
54048
|
+
});
|
|
54049
|
+
}
|
|
54050
|
+
function bindElement(e) {
|
|
54051
|
+
if (isBindingPattern(e.name)) {
|
|
54052
|
+
return bindPattern(e.name);
|
|
54053
|
+
}
|
|
54054
|
+
const symbol = getSymbolOfDeclaration(e);
|
|
54055
|
+
add(symbol.escapedName, symbol);
|
|
54056
|
+
}
|
|
54057
|
+
})) {
|
|
54058
|
+
add(param.escapedName, param);
|
|
54059
|
+
}
|
|
54060
|
+
}
|
|
54061
|
+
}
|
|
54062
|
+
);
|
|
54063
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
54064
|
+
pushFakeScope2(
|
|
54065
|
+
"typeParams",
|
|
54066
|
+
(add) => {
|
|
54067
|
+
for (const typeParam of typeParameters ?? emptyArray) {
|
|
54068
|
+
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
54069
|
+
add(typeParamName, typeParam.symbol);
|
|
54070
|
+
}
|
|
54071
|
+
}
|
|
54072
|
+
);
|
|
54073
|
+
}
|
|
54074
|
+
return cleanup;
|
|
54075
|
+
}
|
|
54076
|
+
}
|
|
54048
54077
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
54049
54078
|
if (signature.thisParameter) {
|
|
54050
54079
|
return symbolToParameterDeclaration(signature.thisParameter, context);
|
|
@@ -54663,6 +54692,9 @@ function createTypeChecker(host) {
|
|
|
54663
54692
|
if (initial.typeParameterSymbolList) {
|
|
54664
54693
|
initial.typeParameterSymbolList = new Set(initial.typeParameterSymbolList);
|
|
54665
54694
|
}
|
|
54695
|
+
if (initial.typeParameterNamesByTextNextNameCount) {
|
|
54696
|
+
initial.typeParameterNamesByTextNextNameCount = new Map(initial.typeParameterNamesByTextNextNameCount);
|
|
54697
|
+
}
|
|
54666
54698
|
initial.tracker = new SymbolTrackerImpl(initial, initial.tracker.inner, initial.tracker.moduleResolverHost);
|
|
54667
54699
|
return initial;
|
|
54668
54700
|
}
|
|
@@ -54795,6 +54827,22 @@ function createTypeChecker(host) {
|
|
|
54795
54827
|
}
|
|
54796
54828
|
return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed;
|
|
54797
54829
|
function visitExistingNodeTreeSymbols(node) {
|
|
54830
|
+
const onExitNewScope = isNewScopeNode(node) ? onEnterNewScope(node) : void 0;
|
|
54831
|
+
const result = visitExistingNodeTreeSymbolsWorker(node);
|
|
54832
|
+
onExitNewScope == null ? void 0 : onExitNewScope();
|
|
54833
|
+
return result;
|
|
54834
|
+
}
|
|
54835
|
+
function onEnterNewScope(node) {
|
|
54836
|
+
const oldContex = context;
|
|
54837
|
+
context = cloneNodeBuilderContext(context);
|
|
54838
|
+
const cleanup = enterNewScope(context, node, getParametersInScope(node), getTypeParametersInScope(node));
|
|
54839
|
+
return onExitNewScope;
|
|
54840
|
+
function onExitNewScope() {
|
|
54841
|
+
cleanup == null ? void 0 : cleanup();
|
|
54842
|
+
context = oldContex;
|
|
54843
|
+
}
|
|
54844
|
+
}
|
|
54845
|
+
function visitExistingNodeTreeSymbolsWorker(node) {
|
|
54798
54846
|
if (isJSDocAllType(node) || node.kind === 319 /* JSDocNamepathType */) {
|
|
54799
54847
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
54800
54848
|
}
|
|
@@ -54945,6 +54993,21 @@ function createTypeChecker(host) {
|
|
|
54945
54993
|
setEmitFlags(clone2, flags | (context.flags & 1024 /* MultilineObjectLiterals */ && isTypeLiteralNode(node) ? 0 : 1 /* SingleLine */));
|
|
54946
54994
|
return clone2;
|
|
54947
54995
|
}
|
|
54996
|
+
if (isConditionalTypeNode(node)) {
|
|
54997
|
+
const checkType = visitNode(node.checkType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
54998
|
+
const disposeScope = onEnterNewScope(node);
|
|
54999
|
+
const extendType = visitNode(node.extendsType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
55000
|
+
const trueType2 = visitNode(node.trueType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
55001
|
+
disposeScope();
|
|
55002
|
+
const falseType2 = visitNode(node.falseType, visitExistingNodeTreeSymbols, isTypeNode);
|
|
55003
|
+
return factory.updateConditionalTypeNode(
|
|
55004
|
+
node,
|
|
55005
|
+
checkType,
|
|
55006
|
+
extendType,
|
|
55007
|
+
trueType2,
|
|
55008
|
+
falseType2
|
|
55009
|
+
);
|
|
55010
|
+
}
|
|
54948
55011
|
return visitEachChild(
|
|
54949
55012
|
node,
|
|
54950
55013
|
visitExistingNodeTreeSymbols,
|
|
@@ -56816,32 +56879,9 @@ function createTypeChecker(host) {
|
|
|
56816
56879
|
}
|
|
56817
56880
|
}).parent;
|
|
56818
56881
|
}
|
|
56819
|
-
function getInstanceTypeOfClassSymbol(classSymbol) {
|
|
56820
|
-
const classType = getDeclaredTypeOfSymbol(classSymbol);
|
|
56821
|
-
const objectFlags = getObjectFlags(classType);
|
|
56822
|
-
if (!(objectFlags & 3 /* ClassOrInterface */) || !classType.typeParameters) {
|
|
56823
|
-
return classType;
|
|
56824
|
-
}
|
|
56825
|
-
const variances = getVariances(classType);
|
|
56826
|
-
const isJs = some(classSymbol.declarations, isInJSFile);
|
|
56827
|
-
const inferredTypes = calculateInferredTypeArguments(classType.typeParameters, isJs);
|
|
56828
|
-
const typeArguments = map(inferredTypes, (inferredType, i) => {
|
|
56829
|
-
if (!strictInstanceOfTypeParameters) {
|
|
56830
|
-
return anyType;
|
|
56831
|
-
}
|
|
56832
|
-
const variance = variances[i];
|
|
56833
|
-
switch (variance & 7 /* VarianceMask */) {
|
|
56834
|
-
case 2 /* Contravariant */:
|
|
56835
|
-
case 3 /* Bivariant */:
|
|
56836
|
-
return neverType;
|
|
56837
|
-
}
|
|
56838
|
-
return inferredType || unknownType;
|
|
56839
|
-
});
|
|
56840
|
-
return createTypeReference(classType, typeArguments);
|
|
56841
|
-
}
|
|
56842
56882
|
function getTypeOfPrototypeProperty(prototype) {
|
|
56843
|
-
const
|
|
56844
|
-
return
|
|
56883
|
+
const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype));
|
|
56884
|
+
return classType.typeParameters ? createTypeReference(classType, map(classType.typeParameters, (_) => anyType)) : classType;
|
|
56845
56885
|
}
|
|
56846
56886
|
function getTypeOfPropertyOfType(type, name) {
|
|
56847
56887
|
const prop = getPropertyOfType(type, name);
|
|
@@ -60542,26 +60582,6 @@ function createTypeChecker(host) {
|
|
|
60542
60582
|
}
|
|
60543
60583
|
return typeArguments && typeArguments.slice();
|
|
60544
60584
|
}
|
|
60545
|
-
function calculateInferredTypeArguments(typeParameters, isJavaScriptImplicitAny) {
|
|
60546
|
-
const numTypeParameters = length(typeParameters);
|
|
60547
|
-
if (!numTypeParameters) {
|
|
60548
|
-
return [];
|
|
60549
|
-
}
|
|
60550
|
-
const result = [];
|
|
60551
|
-
for (let i = 0; i < numTypeParameters; i++) {
|
|
60552
|
-
result[i] = errorType;
|
|
60553
|
-
}
|
|
60554
|
-
const baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny);
|
|
60555
|
-
for (let i = 0; i < numTypeParameters; i++) {
|
|
60556
|
-
let inferredType = getBaseConstraintOfType(typeParameters[i]);
|
|
60557
|
-
if (isJavaScriptImplicitAny && inferredType && (isTypeIdenticalTo(inferredType, unknownType) || isTypeIdenticalTo(inferredType, emptyObjectType))) {
|
|
60558
|
-
inferredType = anyType;
|
|
60559
|
-
}
|
|
60560
|
-
result[i] = inferredType ? instantiateType(inferredType, createTypeMapper(typeParameters, result)) : baseDefaultType;
|
|
60561
|
-
}
|
|
60562
|
-
result.length = typeParameters.length;
|
|
60563
|
-
return result;
|
|
60564
|
-
}
|
|
60565
60585
|
function getSignatureFromDeclaration(declaration) {
|
|
60566
60586
|
const links = getNodeLinks(declaration);
|
|
60567
60587
|
if (!links.resolvedSignature) {
|
|
@@ -71871,8 +71891,8 @@ function createTypeChecker(host) {
|
|
|
71871
71891
|
if (symbol === void 0) {
|
|
71872
71892
|
return type;
|
|
71873
71893
|
}
|
|
71874
|
-
const classSymbol =
|
|
71875
|
-
const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) :
|
|
71894
|
+
const classSymbol = symbol.parent;
|
|
71895
|
+
const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol);
|
|
71876
71896
|
return getNarrowedType(
|
|
71877
71897
|
type,
|
|
71878
71898
|
targetType,
|
|
@@ -79329,17 +79349,18 @@ function createTypeChecker(host) {
|
|
|
79329
79349
|
const antecedent = expr.flowNode || expr.parent.kind === 253 /* ReturnStatement */ && expr.parent.flowNode || { flags: 2 /* Start */ };
|
|
79330
79350
|
const trueCondition = {
|
|
79331
79351
|
flags: 32 /* TrueCondition */,
|
|
79332
|
-
|
|
79333
|
-
|
|
79352
|
+
antecedent,
|
|
79353
|
+
node: expr
|
|
79334
79354
|
};
|
|
79335
79355
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
|
79336
79356
|
if (trueType2 === initType)
|
|
79337
79357
|
return void 0;
|
|
79338
79358
|
const falseCondition = {
|
|
79339
|
-
|
|
79340
|
-
|
|
79359
|
+
flags: 64 /* FalseCondition */,
|
|
79360
|
+
antecedent,
|
|
79361
|
+
node: expr
|
|
79341
79362
|
};
|
|
79342
|
-
const falseSubtype = getFlowTypeOfReference(param.name,
|
|
79363
|
+
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
79343
79364
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
79344
79365
|
}
|
|
79345
79366
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
@@ -122202,6 +122223,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122202
122223
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
|
122203
122224
|
isSourceOfProjectReferenceRedirect,
|
|
122204
122225
|
getRedirectReferenceForResolutionFromSourceOfProject,
|
|
122226
|
+
getRedirectReferenceForResolution,
|
|
122205
122227
|
emitBuildInfo,
|
|
122206
122228
|
fileExists,
|
|
122207
122229
|
readFile,
|
|
@@ -127158,7 +127180,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127158
127180
|
getResolutionWithResolvedFileName,
|
|
127159
127181
|
deferWatchingNonRelativeResolution,
|
|
127160
127182
|
shouldRetryResolution,
|
|
127161
|
-
logChanges
|
|
127183
|
+
logChanges,
|
|
127184
|
+
canWatchFailedLookups
|
|
127162
127185
|
}) {
|
|
127163
127186
|
const path = resolutionHost.toPath(containingFile);
|
|
127164
127187
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
@@ -127181,7 +127204,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127181
127204
|
}
|
|
127182
127205
|
resolutionsInFile.set(name, mode, resolution);
|
|
127183
127206
|
if (resolution !== existingResolution) {
|
|
127184
|
-
watchFailedLookupLocationsOfExternalModuleResolutions(
|
|
127207
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(
|
|
127208
|
+
name,
|
|
127209
|
+
resolution,
|
|
127210
|
+
path,
|
|
127211
|
+
getResolutionWithResolvedFileName,
|
|
127212
|
+
deferWatchingNonRelativeResolution,
|
|
127213
|
+
(resolution2) => canWatchFailedLookups(resolution2, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options, containingSourceFile)
|
|
127214
|
+
);
|
|
127185
127215
|
if (existingResolution) {
|
|
127186
127216
|
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
127187
127217
|
}
|
|
@@ -127260,7 +127290,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127260
127290
|
),
|
|
127261
127291
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
127262
127292
|
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
|
|
127263
|
-
deferWatchingNonRelativeResolution: false
|
|
127293
|
+
deferWatchingNonRelativeResolution: false,
|
|
127294
|
+
canWatchFailedLookups: canWatchFailedLookupsOfTypeReferencedDirective
|
|
127264
127295
|
});
|
|
127265
127296
|
}
|
|
127266
127297
|
function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
@@ -127282,8 +127313,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127282
127313
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
127283
127314
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
127284
127315
|
logChanges: logChangesWhenResolvingModule,
|
|
127285
|
-
deferWatchingNonRelativeResolution: true
|
|
127316
|
+
deferWatchingNonRelativeResolution: true,
|
|
127286
127317
|
// Defer non relative resolution watch because we could be using ambient modules
|
|
127318
|
+
canWatchFailedLookups: canWatchFailedLookupsOfResolvedModule
|
|
127287
127319
|
});
|
|
127288
127320
|
}
|
|
127289
127321
|
function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
|
|
@@ -127299,7 +127331,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127299
127331
|
path,
|
|
127300
127332
|
getResolvedModule,
|
|
127301
127333
|
/*deferWatchingNonRelativeResolution*/
|
|
127302
|
-
false
|
|
127334
|
+
false,
|
|
127335
|
+
canWatchFailedLookupsOfResolvedLibrary
|
|
127303
127336
|
);
|
|
127304
127337
|
resolvedLibraries.set(libFileName, resolution);
|
|
127305
127338
|
if (existingResolution) {
|
|
@@ -127346,16 +127379,18 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127346
127379
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
127347
127380
|
return endsWith(dirPath, "/node_modules/@types");
|
|
127348
127381
|
}
|
|
127349
|
-
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) {
|
|
127350
|
-
var _a;
|
|
127382
|
+
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution, canWatchFailedLookups) {
|
|
127383
|
+
var _a, _b;
|
|
127351
127384
|
if (resolution.refCount) {
|
|
127352
127385
|
resolution.refCount++;
|
|
127353
127386
|
Debug.assertIsDefined(resolution.files);
|
|
127354
127387
|
} else {
|
|
127355
127388
|
resolution.refCount = 1;
|
|
127356
127389
|
Debug.assert(!((_a = resolution.files) == null ? void 0 : _a.size));
|
|
127390
|
+
if (((_b = resolution.failedLookupLocations) == null ? void 0 : _b.length) && canWatchFailedLookups(resolution))
|
|
127391
|
+
resolution.canWatchFailedLookups = true;
|
|
127357
127392
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
127358
|
-
|
|
127393
|
+
watchFailedLookupLocationAndAffectedLocationsOfResolution(resolution);
|
|
127359
127394
|
} else {
|
|
127360
127395
|
nonRelativeExternalModuleResolutions.add(name, resolution);
|
|
127361
127396
|
}
|
|
@@ -127391,15 +127426,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127391
127426
|
}
|
|
127392
127427
|
return setAtRoot;
|
|
127393
127428
|
}
|
|
127394
|
-
function
|
|
127429
|
+
function watchFailedLookupLocationAndAffectedLocationsOfResolution(resolution) {
|
|
127395
127430
|
Debug.assert(!!resolution.refCount);
|
|
127396
127431
|
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
127397
127432
|
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult)
|
|
127398
127433
|
return;
|
|
127399
|
-
|
|
127434
|
+
const addToFailedLookup = resolution.canWatchFailedLookups || alternateResult;
|
|
127435
|
+
if (addToFailedLookup)
|
|
127400
127436
|
resolutionsWithFailedLookups.add(resolution);
|
|
127401
127437
|
let setAtRoot = false;
|
|
127402
|
-
if (
|
|
127438
|
+
if (resolution.canWatchFailedLookups) {
|
|
127403
127439
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
127404
127440
|
setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot);
|
|
127405
127441
|
}
|
|
@@ -127414,7 +127450,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127414
127450
|
true
|
|
127415
127451
|
);
|
|
127416
127452
|
}
|
|
127417
|
-
watchAffectingLocationsOfResolution(resolution, !
|
|
127453
|
+
watchAffectingLocationsOfResolution(resolution, !addToFailedLookup);
|
|
127418
127454
|
}
|
|
127419
127455
|
function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
|
|
127420
127456
|
Debug.assert(!!resolution.refCount);
|
|
@@ -127501,7 +127537,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127501
127537
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
127502
127538
|
const program = resolutionHost.getCurrentProgram();
|
|
127503
127539
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
127504
|
-
resolutions.forEach(
|
|
127540
|
+
resolutions.forEach(watchFailedLookupLocationAndAffectedLocationsOfResolution);
|
|
127505
127541
|
} else {
|
|
127506
127542
|
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
127507
127543
|
resolution,
|
|
@@ -127552,10 +127588,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127552
127588
|
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
127553
127589
|
resolvedFileToResolution.delete(key);
|
|
127554
127590
|
}
|
|
127555
|
-
const { failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
127591
|
+
const { canWatchFailedLookups, failedLookupLocations, affectingLocations, alternateResult } = resolution;
|
|
127556
127592
|
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
127557
127593
|
let removeAtRoot = false;
|
|
127558
|
-
if (
|
|
127594
|
+
if (canWatchFailedLookups) {
|
|
127559
127595
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
127560
127596
|
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
127561
127597
|
}
|
|
@@ -127728,7 +127764,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
127728
127764
|
return true;
|
|
127729
127765
|
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
|
|
127730
127766
|
return false;
|
|
127731
|
-
return ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
|
|
127767
|
+
return resolution.canWatchFailedLookups && ((_a = resolution.failedLookupLocations) == null ? void 0 : _a.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult));
|
|
127732
127768
|
}
|
|
127733
127769
|
function isInvalidatedFailedLookup(locationPath) {
|
|
127734
127770
|
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0);
|
|
@@ -127791,6 +127827,16 @@ function resolutionIsSymlink(resolution) {
|
|
|
127791
127827
|
var _a, _b;
|
|
127792
127828
|
return !!(((_a = resolution.resolvedModule) == null ? void 0 : _a.originalPath) || ((_b = resolution.resolvedTypeReferenceDirective) == null ? void 0 : _b.originalPath));
|
|
127793
127829
|
}
|
|
127830
|
+
function canWatchFailedLookupsOfResolvedModule(resolution, optionsForFile, file) {
|
|
127831
|
+
var _a;
|
|
127832
|
+
return !resolution.resolvedModule || !!resolution.alternateResult || !!((_a = resolution.resolutionDiagnostics) == null ? void 0 : _a.length) || !!getResolutionDiagnostic(optionsForFile, resolution.resolvedModule, file);
|
|
127833
|
+
}
|
|
127834
|
+
function canWatchFailedLookupsOfTypeReferencedDirective(resolution) {
|
|
127835
|
+
return !resolution.resolvedTypeReferenceDirective;
|
|
127836
|
+
}
|
|
127837
|
+
function canWatchFailedLookupsOfResolvedLibrary(resolution) {
|
|
127838
|
+
return !resolution.resolvedModule;
|
|
127839
|
+
}
|
|
127794
127840
|
|
|
127795
127841
|
// src/compiler/watch.ts
|
|
127796
127842
|
var sysFormatDiagnosticsHost = sys ? {
|
|
@@ -173628,7 +173674,8 @@ var SmartIndenter;
|
|
|
173628
173674
|
return childKind !== 290 /* JsxClosingFragment */;
|
|
173629
173675
|
case 193 /* IntersectionType */:
|
|
173630
173676
|
case 192 /* UnionType */:
|
|
173631
|
-
|
|
173677
|
+
case 238 /* SatisfiesExpression */:
|
|
173678
|
+
if (childKind === 187 /* TypeLiteral */ || childKind === 189 /* TupleType */ || childKind === 200 /* MappedType */) {
|
|
173632
173679
|
return false;
|
|
173633
173680
|
}
|
|
173634
173681
|
break;
|
|
@@ -173895,6 +173942,9 @@ __export(ts_exports2, {
|
|
|
173895
173942
|
canWatchAffectingLocation: () => canWatchAffectingLocation,
|
|
173896
173943
|
canWatchAtTypes: () => canWatchAtTypes,
|
|
173897
173944
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
173945
|
+
canWatchFailedLookupsOfResolvedLibrary: () => canWatchFailedLookupsOfResolvedLibrary,
|
|
173946
|
+
canWatchFailedLookupsOfResolvedModule: () => canWatchFailedLookupsOfResolvedModule,
|
|
173947
|
+
canWatchFailedLookupsOfTypeReferencedDirective: () => canWatchFailedLookupsOfTypeReferencedDirective,
|
|
173898
173948
|
cartesianProduct: () => cartesianProduct,
|
|
173899
173949
|
cast: () => cast,
|
|
173900
173950
|
chainBundle: () => chainBundle,
|
|
@@ -188111,6 +188161,9 @@ if (typeof console !== "undefined") {
|
|
|
188111
188161
|
canWatchAffectingLocation,
|
|
188112
188162
|
canWatchAtTypes,
|
|
188113
188163
|
canWatchDirectoryOrFile,
|
|
188164
|
+
canWatchFailedLookupsOfResolvedLibrary,
|
|
188165
|
+
canWatchFailedLookupsOfResolvedModule,
|
|
188166
|
+
canWatchFailedLookupsOfTypeReferencedDirective,
|
|
188114
188167
|
cartesianProduct,
|
|
188115
188168
|
cast,
|
|
188116
188169
|
chainBundle,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-pr-
|
|
5
|
+
"version": "5.5.0-pr-58065-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"eslint-formatter-autolinkable-stylish": "^1.3.0",
|
|
65
65
|
"eslint-plugin-local": "^4.2.1",
|
|
66
66
|
"eslint-plugin-no-null": "^1.0.2",
|
|
67
|
-
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
68
67
|
"fast-xml-parser": "^4.3.6",
|
|
69
68
|
"glob": "^10.3.10",
|
|
70
69
|
"hereby": "^1.8.9",
|
|
@@ -113,5 +112,5 @@
|
|
|
113
112
|
"node": "20.1.0",
|
|
114
113
|
"npm": "8.19.4"
|
|
115
114
|
},
|
|
116
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "4015c51a64510d78a1e92effb162fca3c8464e7c"
|
|
117
116
|
}
|