@typescript-deploys/pr-build 5.6.0-pr-58824-2 → 5.6.0-pr-58829-3
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 +106 -24
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +109 -24
- 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.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240611`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7551,6 +7551,8 @@ var Diagnostics = {
|
|
|
7551
7551
|
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."),
|
|
7552
7552
|
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."),
|
|
7553
7553
|
Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations: diag(9039, 1 /* Error */, "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039", "Type containing private name '{0}' can't be used with --isolatedDeclarations."),
|
|
7554
|
+
keyof_type_must_have_an_operand_type: diag(9040, 1 /* Error */, "keyof_type_must_have_an_operand_type_9040", "`keyof` type must have an operand type."),
|
|
7555
|
+
A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_literal_type: diag(9041, 1 /* Error */, "A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_lit_9041", "A `satisfies keyof` computed property name must be exactly a single string, number, or unique symbol literal type."),
|
|
7554
7556
|
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'."),
|
|
7555
7557
|
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."),
|
|
7556
7558
|
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}'."),
|
|
@@ -19366,6 +19368,9 @@ function hasInferredType(node) {
|
|
|
19366
19368
|
return false;
|
|
19367
19369
|
}
|
|
19368
19370
|
}
|
|
19371
|
+
function isSatisfiesKeyofExpression(node) {
|
|
19372
|
+
return node.kind === 238 /* SatisfiesExpression */ && node.type.kind === 143 /* KeyOfKeyword */ && isEntityNameExpression(node.expression);
|
|
19373
|
+
}
|
|
19369
19374
|
|
|
19370
19375
|
// src/compiler/factory/baseNodeFactory.ts
|
|
19371
19376
|
function createBaseNodeFactory() {
|
|
@@ -30552,7 +30557,8 @@ var Parser;
|
|
|
30552
30557
|
function parseTypeOperator(operator) {
|
|
30553
30558
|
const pos = getNodePos();
|
|
30554
30559
|
parseExpected(operator);
|
|
30555
|
-
|
|
30560
|
+
const arg = operator !== 143 /* KeyOfKeyword */ || isStartOfType() ? parseTypeOperatorOrHigher() : void 0;
|
|
30561
|
+
return finishNode(arg ? factory2.createTypeOperatorNode(operator, arg) : factory2.createKeywordTypeNode(143 /* KeyOfKeyword */), pos);
|
|
30556
30562
|
}
|
|
30557
30563
|
function tryParseConstraintOfInferType() {
|
|
30558
30564
|
if (parseOptional(96 /* ExtendsKeyword */)) {
|
|
@@ -49159,7 +49165,7 @@ function createTypeChecker(host) {
|
|
|
49159
49165
|
}
|
|
49160
49166
|
function getMeaningOfEntityNameReference(entityName) {
|
|
49161
49167
|
let meaning;
|
|
49162
|
-
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName) {
|
|
49168
|
+
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName || isSatisfiesKeyofExpression(entityName.parent)) {
|
|
49163
49169
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
49164
49170
|
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
|
|
49165
49171
|
meaning = 1920 /* Namespace */;
|
|
@@ -50272,7 +50278,7 @@ function createTypeChecker(host) {
|
|
|
50272
50278
|
trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
|
|
50273
50279
|
}
|
|
50274
50280
|
} else {
|
|
50275
|
-
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
|
|
50281
|
+
trackComputedName(isEntityNameExpression(decl.name.expression) ? decl.name.expression : decl.name.expression.expression, saveEnclosingDeclaration, context);
|
|
50276
50282
|
}
|
|
50277
50283
|
}
|
|
50278
50284
|
} else {
|
|
@@ -50769,7 +50775,7 @@ function createTypeChecker(host) {
|
|
|
50769
50775
|
return elideInitializerAndSetEmitFlags(node);
|
|
50770
50776
|
function elideInitializerAndSetEmitFlags(node2) {
|
|
50771
50777
|
if (context.tracker.canTrackSymbol && isComputedPropertyName(node2) && isLateBindableName(node2)) {
|
|
50772
|
-
trackComputedName(node2.expression, context.enclosingDeclaration, context);
|
|
50778
|
+
trackComputedName(isEntityNameExpression(node2.expression) ? node2.expression : node2.expression.expression, context.enclosingDeclaration, context);
|
|
50773
50779
|
}
|
|
50774
50780
|
let visited = visitEachChild(
|
|
50775
50781
|
node2,
|
|
@@ -53851,7 +53857,7 @@ function createTypeChecker(host) {
|
|
|
53851
53857
|
}
|
|
53852
53858
|
}
|
|
53853
53859
|
function pushTypeResolution(target, propertyName) {
|
|
53854
|
-
const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName
|
|
53860
|
+
const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName);
|
|
53855
53861
|
if (resolutionCycleStartIndex >= 0) {
|
|
53856
53862
|
const { length: length2 } = resolutionTargets;
|
|
53857
53863
|
for (let i = resolutionCycleStartIndex; i < length2; i++) {
|
|
@@ -53867,11 +53873,8 @@ function createTypeChecker(host) {
|
|
|
53867
53873
|
resolutionPropertyNames.push(propertyName);
|
|
53868
53874
|
return true;
|
|
53869
53875
|
}
|
|
53870
|
-
function
|
|
53871
|
-
|
|
53872
|
-
}
|
|
53873
|
-
function findResolutionCycleStartIndex(target, propertyName, start) {
|
|
53874
|
-
for (let i = resolutionTargets.length - 1; i >= start; i--) {
|
|
53876
|
+
function findResolutionCycleStartIndex(target, propertyName) {
|
|
53877
|
+
for (let i = resolutionTargets.length - 1; i >= resolutionStart; i--) {
|
|
53875
53878
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
53876
53879
|
return -1;
|
|
53877
53880
|
}
|
|
@@ -55722,7 +55725,10 @@ function createTypeChecker(host) {
|
|
|
55722
55725
|
if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
|
|
55723
55726
|
return false;
|
|
55724
55727
|
}
|
|
55725
|
-
|
|
55728
|
+
let expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
|
|
55729
|
+
if (isSatisfiesExpression(expr) && expr.type.kind === 143 /* KeyOfKeyword */) {
|
|
55730
|
+
expr = expr.expression;
|
|
55731
|
+
}
|
|
55726
55732
|
return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
|
|
55727
55733
|
}
|
|
55728
55734
|
function isLateBoundName(name) {
|
|
@@ -57927,7 +57933,7 @@ function createTypeChecker(host) {
|
|
|
57927
57933
|
return getReturnTypeOfTypeTag(declaration);
|
|
57928
57934
|
}
|
|
57929
57935
|
function isResolvingReturnTypeOfSignature(signature) {
|
|
57930
|
-
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType &&
|
|
57936
|
+
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
57931
57937
|
}
|
|
57932
57938
|
function getRestTypeOfSignature(signature) {
|
|
57933
57939
|
return tryGetRestTypeOfSignature(signature) || anyType;
|
|
@@ -61088,6 +61094,13 @@ function createTypeChecker(host) {
|
|
|
61088
61094
|
type.escapedName = `__@${type.symbol.escapedName}@${getSymbolId(type.symbol)}`;
|
|
61089
61095
|
return type;
|
|
61090
61096
|
}
|
|
61097
|
+
function getUniqueESSymbolTypeForSymbol(symbol) {
|
|
61098
|
+
const links = getSymbolLinks(symbol);
|
|
61099
|
+
if (!links.uniqueESSymbolType) {
|
|
61100
|
+
links.uniqueESSymbolType = createUniqueESSymbolType(symbol);
|
|
61101
|
+
}
|
|
61102
|
+
return links.uniqueESSymbolType;
|
|
61103
|
+
}
|
|
61091
61104
|
function getESSymbolLikeTypeForNode(node) {
|
|
61092
61105
|
if (isInJSFile(node) && isJSDocTypeExpression(node)) {
|
|
61093
61106
|
const host2 = getJSDocHost(node);
|
|
@@ -61098,8 +61111,7 @@ function createTypeChecker(host) {
|
|
|
61098
61111
|
if (isValidESSymbolDeclaration(node)) {
|
|
61099
61112
|
const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
|
|
61100
61113
|
if (symbol) {
|
|
61101
|
-
|
|
61102
|
-
return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
|
|
61114
|
+
return getUniqueESSymbolTypeForSymbol(symbol);
|
|
61103
61115
|
}
|
|
61104
61116
|
}
|
|
61105
61117
|
return esSymbolType;
|
|
@@ -61167,6 +61179,12 @@ function createTypeChecker(host) {
|
|
|
61167
61179
|
!!node.questionToken
|
|
61168
61180
|
));
|
|
61169
61181
|
}
|
|
61182
|
+
function getTypeFromKeyofKeywordTypeNode(node) {
|
|
61183
|
+
if (!isSatisfiesExpression(node.parent) || !isComputedPropertyName(node.parent.parent)) {
|
|
61184
|
+
error(node, Diagnostics.keyof_type_must_have_an_operand_type);
|
|
61185
|
+
}
|
|
61186
|
+
return stringNumberSymbolType;
|
|
61187
|
+
}
|
|
61170
61188
|
function getTypeFromTypeNode(node) {
|
|
61171
61189
|
return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);
|
|
61172
61190
|
}
|
|
@@ -61262,6 +61280,8 @@ function createTypeChecker(host) {
|
|
|
61262
61280
|
case 211 /* PropertyAccessExpression */:
|
|
61263
61281
|
const symbol = getSymbolAtLocation(node);
|
|
61264
61282
|
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
|
|
61283
|
+
case 143 /* KeyOfKeyword */:
|
|
61284
|
+
return getTypeFromKeyofKeywordTypeNode(node);
|
|
61265
61285
|
default:
|
|
61266
61286
|
return errorType;
|
|
61267
61287
|
}
|
|
@@ -61552,7 +61572,7 @@ function createTypeChecker(host) {
|
|
|
61552
61572
|
if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
|
|
61553
61573
|
if (!type.declaration.nameType) {
|
|
61554
61574
|
let constraint;
|
|
61555
|
-
if (isArrayType(t) || t.flags & 1 /* Any */ &&
|
|
61575
|
+
if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
|
|
61556
61576
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
61557
61577
|
}
|
|
61558
61578
|
if (isTupleType(t)) {
|
|
@@ -70915,7 +70935,7 @@ function createTypeChecker(host) {
|
|
|
70915
70935
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
70916
70936
|
}
|
|
70917
70937
|
function isCircularMappedProperty(symbol) {
|
|
70918
|
-
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type &&
|
|
70938
|
+
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
70919
70939
|
}
|
|
70920
70940
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
70921
70941
|
return mapType(
|
|
@@ -73446,7 +73466,20 @@ function createTypeChecker(host) {
|
|
|
73446
73466
|
}
|
|
73447
73467
|
}
|
|
73448
73468
|
const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
|
|
73449
|
-
|
|
73469
|
+
const result = checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
|
|
73470
|
+
if (!isErrorType(result)) {
|
|
73471
|
+
return result;
|
|
73472
|
+
}
|
|
73473
|
+
if (isEntityNameExpression(indexExpression)) {
|
|
73474
|
+
const fallback = getResolvedEntityNameUniqueSymbolType(indexExpression);
|
|
73475
|
+
if (fallback) {
|
|
73476
|
+
const indexedAccessType2 = getIndexedAccessTypeOrUndefined(objectType, fallback, accessFlags) || errorType;
|
|
73477
|
+
if (!isErrorType(indexedAccessType2) && !(indexedAccessType2.flags & 8388608 /* IndexedAccess */ && indexedAccessType2.objectType === objectType && indexedAccessType2.indexType === fallback)) {
|
|
73478
|
+
return getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType2, indexExpression, checkMode);
|
|
73479
|
+
}
|
|
73480
|
+
}
|
|
73481
|
+
}
|
|
73482
|
+
return result;
|
|
73450
73483
|
}
|
|
73451
73484
|
function callLikeExpressionMayHaveTypeArguments(node) {
|
|
73452
73485
|
return isCallOrNewExpression(node) || isTaggedTemplateExpression(node) || isJsxOpeningLikeElement(node);
|
|
@@ -75694,13 +75727,49 @@ function createTypeChecker(host) {
|
|
|
75694
75727
|
checkSourceElement(node.type);
|
|
75695
75728
|
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
75696
75729
|
}
|
|
75730
|
+
function getResolvedEntityNameUniqueSymbolType(expression) {
|
|
75731
|
+
const links = getNodeLinks(expression);
|
|
75732
|
+
if (!links.uniqueSymbollFallback) {
|
|
75733
|
+
let resolved = resolveEntityName(
|
|
75734
|
+
expression,
|
|
75735
|
+
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
75736
|
+
/*ignoreErrors*/
|
|
75737
|
+
true
|
|
75738
|
+
);
|
|
75739
|
+
if (!resolved || resolved === unknownSymbol) {
|
|
75740
|
+
resolved = resolveEntityName(
|
|
75741
|
+
expression,
|
|
75742
|
+
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
75743
|
+
/*ignoreErrors*/
|
|
75744
|
+
true,
|
|
75745
|
+
/*dontResolveAlias*/
|
|
75746
|
+
true
|
|
75747
|
+
);
|
|
75748
|
+
}
|
|
75749
|
+
if (resolved) {
|
|
75750
|
+
links.uniqueSymbollFallback = getUniqueESSymbolTypeForSymbol(resolved);
|
|
75751
|
+
} else {
|
|
75752
|
+
links.uniqueSymbollFallback = false;
|
|
75753
|
+
}
|
|
75754
|
+
}
|
|
75755
|
+
return links.uniqueSymbollFallback || void 0;
|
|
75756
|
+
}
|
|
75697
75757
|
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
75698
75758
|
const exprType = checkExpression(expression, checkMode);
|
|
75759
|
+
const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */);
|
|
75760
|
+
if (target.kind === 143 /* KeyOfKeyword */ && isComputedPropertyName(expression.parent.parent)) {
|
|
75761
|
+
if (!(exprType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
|
|
75762
|
+
error(expression, Diagnostics.A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_literal_type);
|
|
75763
|
+
if (isEntityNameExpression(expression)) {
|
|
75764
|
+
return getResolvedEntityNameUniqueSymbolType(expression) || exprType;
|
|
75765
|
+
}
|
|
75766
|
+
}
|
|
75767
|
+
return exprType;
|
|
75768
|
+
}
|
|
75699
75769
|
const targetType = getTypeFromTypeNode(target);
|
|
75700
75770
|
if (isErrorType(targetType)) {
|
|
75701
75771
|
return targetType;
|
|
75702
75772
|
}
|
|
75703
|
-
const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */);
|
|
75704
75773
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
75705
75774
|
return exprType;
|
|
75706
75775
|
}
|
|
@@ -111526,7 +111595,7 @@ function transformDeclarations(context) {
|
|
|
111526
111595
|
if (isDeclarationAndNotVisible(input)) return;
|
|
111527
111596
|
if (hasDynamicName(input)) {
|
|
111528
111597
|
if (isolatedDeclarations) {
|
|
111529
|
-
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
|
|
111598
|
+
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression) && !isSatisfiesKeyofExpression(input.name.expression)) {
|
|
111530
111599
|
if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
|
|
111531
111600
|
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
111532
111601
|
return;
|
|
@@ -111538,7 +111607,7 @@ function transformDeclarations(context) {
|
|
|
111538
111607
|
return;
|
|
111539
111608
|
}
|
|
111540
111609
|
}
|
|
111541
|
-
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
|
|
111610
|
+
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !(isEntityNameExpression(input.name.expression) || isSatisfiesKeyofExpression(input.name.expression))) {
|
|
111542
111611
|
return;
|
|
111543
111612
|
}
|
|
111544
111613
|
}
|
|
@@ -111809,7 +111878,10 @@ function transformDeclarations(context) {
|
|
|
111809
111878
|
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
|
|
111810
111879
|
function cleanup(returnValue) {
|
|
111811
111880
|
if (returnValue && canProduceDiagnostic && hasDynamicName(input)) {
|
|
111812
|
-
checkName(input);
|
|
111881
|
+
const updated = checkName(input, returnValue);
|
|
111882
|
+
if (updated) {
|
|
111883
|
+
returnValue = updated;
|
|
111884
|
+
}
|
|
111813
111885
|
}
|
|
111814
111886
|
if (isEnclosingDeclaration(input)) {
|
|
111815
111887
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -112318,7 +112390,7 @@ function transformDeclarations(context) {
|
|
|
112318
112390
|
}
|
|
112319
112391
|
}
|
|
112320
112392
|
}
|
|
112321
|
-
function checkName(node) {
|
|
112393
|
+
function checkName(node, returnValue) {
|
|
112322
112394
|
let oldDiag;
|
|
112323
112395
|
if (!suppressNewDiagnosticContexts) {
|
|
112324
112396
|
oldDiag = getSymbolAccessibilityDiagnostic;
|
|
@@ -112328,11 +112400,21 @@ function transformDeclarations(context) {
|
|
|
112328
112400
|
Debug.assert(hasDynamicName(node));
|
|
112329
112401
|
const decl = node;
|
|
112330
112402
|
const entityName = decl.name.expression;
|
|
112331
|
-
|
|
112403
|
+
const nameExpr = isEntityNameExpression(entityName) ? entityName : entityName.expression;
|
|
112404
|
+
checkEntityNameVisibility(nameExpr, enclosingDeclaration);
|
|
112405
|
+
let result = returnValue;
|
|
112406
|
+
if (returnValue && nameExpr !== entityName) {
|
|
112407
|
+
const updated = factory2.updateComputedPropertyName(decl.name, nameExpr);
|
|
112408
|
+
result = factory2.cloneNode(returnValue);
|
|
112409
|
+
result.name = updated;
|
|
112410
|
+
}
|
|
112332
112411
|
if (!suppressNewDiagnosticContexts) {
|
|
112333
112412
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
112334
112413
|
}
|
|
112335
112414
|
errorNameNode = void 0;
|
|
112415
|
+
if (result !== returnValue) {
|
|
112416
|
+
return result;
|
|
112417
|
+
}
|
|
112336
112418
|
}
|
|
112337
112419
|
function shouldStripInternal(node) {
|
|
112338
112420
|
return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile);
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4190,7 +4190,7 @@ declare namespace ts {
|
|
|
4190
4190
|
| SyntaxKind.WithKeyword
|
|
4191
4191
|
| SyntaxKind.YieldKeyword;
|
|
4192
4192
|
type ModifierSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AccessorKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.ConstKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.ExportKeyword | SyntaxKind.InKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.OutKeyword | SyntaxKind.OverrideKeyword | SyntaxKind.StaticKeyword;
|
|
4193
|
-
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword;
|
|
4193
|
+
type KeywordTypeSyntaxKind = SyntaxKind.AnyKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.IntrinsicKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.StringKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VoidKeyword | SyntaxKind.KeyOfKeyword;
|
|
4194
4194
|
type TokenSyntaxKind = SyntaxKind.Unknown | SyntaxKind.EndOfFileToken | TriviaSyntaxKind | LiteralSyntaxKind | PseudoLiteralSyntaxKind | PunctuationSyntaxKind | SyntaxKind.Identifier | KeywordSyntaxKind;
|
|
4195
4195
|
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
|
|
4196
4196
|
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.OpenParenToken | SyntaxKind.CloseParenToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.HashToken | SyntaxKind.Unknown | KeywordSyntaxKind;
|
package/lib/typescript.js
CHANGED
|
@@ -1751,6 +1751,7 @@ __export(typescript_exports, {
|
|
|
1751
1751
|
isRootedDiskPath: () => isRootedDiskPath,
|
|
1752
1752
|
isSameEntityName: () => isSameEntityName,
|
|
1753
1753
|
isSatisfiesExpression: () => isSatisfiesExpression,
|
|
1754
|
+
isSatisfiesKeyofExpression: () => isSatisfiesKeyofExpression,
|
|
1754
1755
|
isScopeMarker: () => isScopeMarker,
|
|
1755
1756
|
isSemicolonClassElement: () => isSemicolonClassElement,
|
|
1756
1757
|
isSetAccessor: () => isSetAccessor,
|
|
@@ -2375,7 +2376,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2375
2376
|
|
|
2376
2377
|
// src/compiler/corePublic.ts
|
|
2377
2378
|
var versionMajorMinor = "5.6";
|
|
2378
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2379
|
+
var version = `${versionMajorMinor}.0-insiders.20240611`;
|
|
2379
2380
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2380
2381
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2381
2382
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11138,6 +11139,8 @@ var Diagnostics = {
|
|
|
11138
11139
|
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."),
|
|
11139
11140
|
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."),
|
|
11140
11141
|
Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations: diag(9039, 1 /* Error */, "Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations_9039", "Type containing private name '{0}' can't be used with --isolatedDeclarations."),
|
|
11142
|
+
keyof_type_must_have_an_operand_type: diag(9040, 1 /* Error */, "keyof_type_must_have_an_operand_type_9040", "`keyof` type must have an operand type."),
|
|
11143
|
+
A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_literal_type: diag(9041, 1 /* Error */, "A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_lit_9041", "A `satisfies keyof` computed property name must be exactly a single string, number, or unique symbol literal type."),
|
|
11141
11144
|
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'."),
|
|
11142
11145
|
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."),
|
|
11143
11146
|
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}'."),
|
|
@@ -23613,6 +23616,9 @@ function hasInferredType(node) {
|
|
|
23613
23616
|
return false;
|
|
23614
23617
|
}
|
|
23615
23618
|
}
|
|
23619
|
+
function isSatisfiesKeyofExpression(node) {
|
|
23620
|
+
return node.kind === 238 /* SatisfiesExpression */ && node.type.kind === 143 /* KeyOfKeyword */ && isEntityNameExpression(node.expression);
|
|
23621
|
+
}
|
|
23616
23622
|
|
|
23617
23623
|
// src/compiler/factory/baseNodeFactory.ts
|
|
23618
23624
|
function createBaseNodeFactory() {
|
|
@@ -34976,7 +34982,8 @@ var Parser;
|
|
|
34976
34982
|
function parseTypeOperator(operator) {
|
|
34977
34983
|
const pos = getNodePos();
|
|
34978
34984
|
parseExpected(operator);
|
|
34979
|
-
|
|
34985
|
+
const arg = operator !== 143 /* KeyOfKeyword */ || isStartOfType() ? parseTypeOperatorOrHigher() : void 0;
|
|
34986
|
+
return finishNode(arg ? factory2.createTypeOperatorNode(operator, arg) : factory2.createKeywordTypeNode(143 /* KeyOfKeyword */), pos);
|
|
34980
34987
|
}
|
|
34981
34988
|
function tryParseConstraintOfInferType() {
|
|
34982
34989
|
if (parseOptional(96 /* ExtendsKeyword */)) {
|
|
@@ -53932,7 +53939,7 @@ function createTypeChecker(host) {
|
|
|
53932
53939
|
}
|
|
53933
53940
|
function getMeaningOfEntityNameReference(entityName) {
|
|
53934
53941
|
let meaning;
|
|
53935
|
-
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName) {
|
|
53942
|
+
if (entityName.parent.kind === 186 /* TypeQuery */ || entityName.parent.kind === 233 /* ExpressionWithTypeArguments */ && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167 /* ComputedPropertyName */ || entityName.parent.kind === 182 /* TypePredicate */ && entityName.parent.parameterName === entityName || isSatisfiesKeyofExpression(entityName.parent)) {
|
|
53936
53943
|
meaning = 111551 /* Value */ | 1048576 /* ExportValue */;
|
|
53937
53944
|
} else if (entityName.kind === 166 /* QualifiedName */ || entityName.kind === 211 /* PropertyAccessExpression */ || entityName.parent.kind === 271 /* ImportEqualsDeclaration */ || entityName.parent.kind === 166 /* QualifiedName */ && entityName.parent.left === entityName || entityName.parent.kind === 211 /* PropertyAccessExpression */ && entityName.parent.expression === entityName || entityName.parent.kind === 212 /* ElementAccessExpression */ && entityName.parent.expression === entityName) {
|
|
53938
53945
|
meaning = 1920 /* Namespace */;
|
|
@@ -55045,7 +55052,7 @@ function createTypeChecker(host) {
|
|
|
55045
55052
|
trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
|
|
55046
55053
|
}
|
|
55047
55054
|
} else {
|
|
55048
|
-
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
|
|
55055
|
+
trackComputedName(isEntityNameExpression(decl.name.expression) ? decl.name.expression : decl.name.expression.expression, saveEnclosingDeclaration, context);
|
|
55049
55056
|
}
|
|
55050
55057
|
}
|
|
55051
55058
|
} else {
|
|
@@ -55542,7 +55549,7 @@ function createTypeChecker(host) {
|
|
|
55542
55549
|
return elideInitializerAndSetEmitFlags(node);
|
|
55543
55550
|
function elideInitializerAndSetEmitFlags(node2) {
|
|
55544
55551
|
if (context.tracker.canTrackSymbol && isComputedPropertyName(node2) && isLateBindableName(node2)) {
|
|
55545
|
-
trackComputedName(node2.expression, context.enclosingDeclaration, context);
|
|
55552
|
+
trackComputedName(isEntityNameExpression(node2.expression) ? node2.expression : node2.expression.expression, context.enclosingDeclaration, context);
|
|
55546
55553
|
}
|
|
55547
55554
|
let visited = visitEachChild(
|
|
55548
55555
|
node2,
|
|
@@ -58624,7 +58631,7 @@ function createTypeChecker(host) {
|
|
|
58624
58631
|
}
|
|
58625
58632
|
}
|
|
58626
58633
|
function pushTypeResolution(target, propertyName) {
|
|
58627
|
-
const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName
|
|
58634
|
+
const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName);
|
|
58628
58635
|
if (resolutionCycleStartIndex >= 0) {
|
|
58629
58636
|
const { length: length2 } = resolutionTargets;
|
|
58630
58637
|
for (let i = resolutionCycleStartIndex; i < length2; i++) {
|
|
@@ -58640,11 +58647,8 @@ function createTypeChecker(host) {
|
|
|
58640
58647
|
resolutionPropertyNames.push(propertyName);
|
|
58641
58648
|
return true;
|
|
58642
58649
|
}
|
|
58643
|
-
function
|
|
58644
|
-
|
|
58645
|
-
}
|
|
58646
|
-
function findResolutionCycleStartIndex(target, propertyName, start) {
|
|
58647
|
-
for (let i = resolutionTargets.length - 1; i >= start; i--) {
|
|
58650
|
+
function findResolutionCycleStartIndex(target, propertyName) {
|
|
58651
|
+
for (let i = resolutionTargets.length - 1; i >= resolutionStart; i--) {
|
|
58648
58652
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
58649
58653
|
return -1;
|
|
58650
58654
|
}
|
|
@@ -60495,7 +60499,10 @@ function createTypeChecker(host) {
|
|
|
60495
60499
|
if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
|
|
60496
60500
|
return false;
|
|
60497
60501
|
}
|
|
60498
|
-
|
|
60502
|
+
let expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
|
|
60503
|
+
if (isSatisfiesExpression(expr) && expr.type.kind === 143 /* KeyOfKeyword */) {
|
|
60504
|
+
expr = expr.expression;
|
|
60505
|
+
}
|
|
60499
60506
|
return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
|
|
60500
60507
|
}
|
|
60501
60508
|
function isLateBoundName(name) {
|
|
@@ -62700,7 +62707,7 @@ function createTypeChecker(host) {
|
|
|
62700
62707
|
return getReturnTypeOfTypeTag(declaration);
|
|
62701
62708
|
}
|
|
62702
62709
|
function isResolvingReturnTypeOfSignature(signature) {
|
|
62703
|
-
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType &&
|
|
62710
|
+
return signature.compositeSignatures && some(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex(signature, 3 /* ResolvedReturnType */) >= 0;
|
|
62704
62711
|
}
|
|
62705
62712
|
function getRestTypeOfSignature(signature) {
|
|
62706
62713
|
return tryGetRestTypeOfSignature(signature) || anyType;
|
|
@@ -65861,6 +65868,13 @@ function createTypeChecker(host) {
|
|
|
65861
65868
|
type.escapedName = `__@${type.symbol.escapedName}@${getSymbolId(type.symbol)}`;
|
|
65862
65869
|
return type;
|
|
65863
65870
|
}
|
|
65871
|
+
function getUniqueESSymbolTypeForSymbol(symbol) {
|
|
65872
|
+
const links = getSymbolLinks(symbol);
|
|
65873
|
+
if (!links.uniqueESSymbolType) {
|
|
65874
|
+
links.uniqueESSymbolType = createUniqueESSymbolType(symbol);
|
|
65875
|
+
}
|
|
65876
|
+
return links.uniqueESSymbolType;
|
|
65877
|
+
}
|
|
65864
65878
|
function getESSymbolLikeTypeForNode(node) {
|
|
65865
65879
|
if (isInJSFile(node) && isJSDocTypeExpression(node)) {
|
|
65866
65880
|
const host2 = getJSDocHost(node);
|
|
@@ -65871,8 +65885,7 @@ function createTypeChecker(host) {
|
|
|
65871
65885
|
if (isValidESSymbolDeclaration(node)) {
|
|
65872
65886
|
const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
|
|
65873
65887
|
if (symbol) {
|
|
65874
|
-
|
|
65875
|
-
return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
|
|
65888
|
+
return getUniqueESSymbolTypeForSymbol(symbol);
|
|
65876
65889
|
}
|
|
65877
65890
|
}
|
|
65878
65891
|
return esSymbolType;
|
|
@@ -65940,6 +65953,12 @@ function createTypeChecker(host) {
|
|
|
65940
65953
|
!!node.questionToken
|
|
65941
65954
|
));
|
|
65942
65955
|
}
|
|
65956
|
+
function getTypeFromKeyofKeywordTypeNode(node) {
|
|
65957
|
+
if (!isSatisfiesExpression(node.parent) || !isComputedPropertyName(node.parent.parent)) {
|
|
65958
|
+
error2(node, Diagnostics.keyof_type_must_have_an_operand_type);
|
|
65959
|
+
}
|
|
65960
|
+
return stringNumberSymbolType;
|
|
65961
|
+
}
|
|
65943
65962
|
function getTypeFromTypeNode(node) {
|
|
65944
65963
|
return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node);
|
|
65945
65964
|
}
|
|
@@ -66035,6 +66054,8 @@ function createTypeChecker(host) {
|
|
|
66035
66054
|
case 211 /* PropertyAccessExpression */:
|
|
66036
66055
|
const symbol = getSymbolAtLocation(node);
|
|
66037
66056
|
return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType;
|
|
66057
|
+
case 143 /* KeyOfKeyword */:
|
|
66058
|
+
return getTypeFromKeyofKeywordTypeNode(node);
|
|
66038
66059
|
default:
|
|
66039
66060
|
return errorType;
|
|
66040
66061
|
}
|
|
@@ -66325,7 +66346,7 @@ function createTypeChecker(host) {
|
|
|
66325
66346
|
if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
|
|
66326
66347
|
if (!type.declaration.nameType) {
|
|
66327
66348
|
let constraint;
|
|
66328
|
-
if (isArrayType(t) || t.flags & 1 /* Any */ &&
|
|
66349
|
+
if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
|
|
66329
66350
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
66330
66351
|
}
|
|
66331
66352
|
if (isTupleType(t)) {
|
|
@@ -75688,7 +75709,7 @@ function createTypeChecker(host) {
|
|
|
75688
75709
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
75689
75710
|
}
|
|
75690
75711
|
function isCircularMappedProperty(symbol) {
|
|
75691
|
-
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type &&
|
|
75712
|
+
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
75692
75713
|
}
|
|
75693
75714
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
75694
75715
|
return mapType(
|
|
@@ -78219,7 +78240,20 @@ function createTypeChecker(host) {
|
|
|
78219
78240
|
}
|
|
78220
78241
|
}
|
|
78221
78242
|
const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
|
|
78222
|
-
|
|
78243
|
+
const result = checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
|
|
78244
|
+
if (!isErrorType(result)) {
|
|
78245
|
+
return result;
|
|
78246
|
+
}
|
|
78247
|
+
if (isEntityNameExpression(indexExpression)) {
|
|
78248
|
+
const fallback = getResolvedEntityNameUniqueSymbolType(indexExpression);
|
|
78249
|
+
if (fallback) {
|
|
78250
|
+
const indexedAccessType2 = getIndexedAccessTypeOrUndefined(objectType, fallback, accessFlags) || errorType;
|
|
78251
|
+
if (!isErrorType(indexedAccessType2) && !(indexedAccessType2.flags & 8388608 /* IndexedAccess */ && indexedAccessType2.objectType === objectType && indexedAccessType2.indexType === fallback)) {
|
|
78252
|
+
return getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType2, indexExpression, checkMode);
|
|
78253
|
+
}
|
|
78254
|
+
}
|
|
78255
|
+
}
|
|
78256
|
+
return result;
|
|
78223
78257
|
}
|
|
78224
78258
|
function callLikeExpressionMayHaveTypeArguments(node) {
|
|
78225
78259
|
return isCallOrNewExpression(node) || isTaggedTemplateExpression(node) || isJsxOpeningLikeElement(node);
|
|
@@ -80467,13 +80501,49 @@ function createTypeChecker(host) {
|
|
|
80467
80501
|
checkSourceElement(node.type);
|
|
80468
80502
|
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
80469
80503
|
}
|
|
80504
|
+
function getResolvedEntityNameUniqueSymbolType(expression) {
|
|
80505
|
+
const links = getNodeLinks(expression);
|
|
80506
|
+
if (!links.uniqueSymbollFallback) {
|
|
80507
|
+
let resolved = resolveEntityName(
|
|
80508
|
+
expression,
|
|
80509
|
+
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
80510
|
+
/*ignoreErrors*/
|
|
80511
|
+
true
|
|
80512
|
+
);
|
|
80513
|
+
if (!resolved || resolved === unknownSymbol) {
|
|
80514
|
+
resolved = resolveEntityName(
|
|
80515
|
+
expression,
|
|
80516
|
+
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
80517
|
+
/*ignoreErrors*/
|
|
80518
|
+
true,
|
|
80519
|
+
/*dontResolveAlias*/
|
|
80520
|
+
true
|
|
80521
|
+
);
|
|
80522
|
+
}
|
|
80523
|
+
if (resolved) {
|
|
80524
|
+
links.uniqueSymbollFallback = getUniqueESSymbolTypeForSymbol(resolved);
|
|
80525
|
+
} else {
|
|
80526
|
+
links.uniqueSymbollFallback = false;
|
|
80527
|
+
}
|
|
80528
|
+
}
|
|
80529
|
+
return links.uniqueSymbollFallback || void 0;
|
|
80530
|
+
}
|
|
80470
80531
|
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
80471
80532
|
const exprType = checkExpression(expression, checkMode);
|
|
80533
|
+
const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */);
|
|
80534
|
+
if (target.kind === 143 /* KeyOfKeyword */ && isComputedPropertyName(expression.parent.parent)) {
|
|
80535
|
+
if (!(exprType.flags & 8576 /* StringOrNumberLiteralOrUnique */)) {
|
|
80536
|
+
error2(expression, Diagnostics.A_satisfies_keyof_computed_property_name_must_be_exactly_a_single_string_number_or_unique_symbol_literal_type);
|
|
80537
|
+
if (isEntityNameExpression(expression)) {
|
|
80538
|
+
return getResolvedEntityNameUniqueSymbolType(expression) || exprType;
|
|
80539
|
+
}
|
|
80540
|
+
}
|
|
80541
|
+
return exprType;
|
|
80542
|
+
}
|
|
80472
80543
|
const targetType = getTypeFromTypeNode(target);
|
|
80473
80544
|
if (isErrorType(targetType)) {
|
|
80474
80545
|
return targetType;
|
|
80475
80546
|
}
|
|
80476
|
-
const errorNode = findAncestor(target.parent, (n) => n.kind === 238 /* SatisfiesExpression */ || n.kind === 350 /* JSDocSatisfiesTag */);
|
|
80477
80547
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
80478
80548
|
return exprType;
|
|
80479
80549
|
}
|
|
@@ -116481,7 +116551,7 @@ function transformDeclarations(context) {
|
|
|
116481
116551
|
if (isDeclarationAndNotVisible(input)) return;
|
|
116482
116552
|
if (hasDynamicName(input)) {
|
|
116483
116553
|
if (isolatedDeclarations) {
|
|
116484
|
-
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
|
|
116554
|
+
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression) && !isSatisfiesKeyofExpression(input.name.expression)) {
|
|
116485
116555
|
if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
|
|
116486
116556
|
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
116487
116557
|
return;
|
|
@@ -116493,7 +116563,7 @@ function transformDeclarations(context) {
|
|
|
116493
116563
|
return;
|
|
116494
116564
|
}
|
|
116495
116565
|
}
|
|
116496
|
-
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
|
|
116566
|
+
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !(isEntityNameExpression(input.name.expression) || isSatisfiesKeyofExpression(input.name.expression))) {
|
|
116497
116567
|
return;
|
|
116498
116568
|
}
|
|
116499
116569
|
}
|
|
@@ -116764,7 +116834,10 @@ function transformDeclarations(context) {
|
|
|
116764
116834
|
return cleanup(visitEachChild(input, visitDeclarationSubtree, context));
|
|
116765
116835
|
function cleanup(returnValue) {
|
|
116766
116836
|
if (returnValue && canProduceDiagnostic && hasDynamicName(input)) {
|
|
116767
|
-
checkName(input);
|
|
116837
|
+
const updated = checkName(input, returnValue);
|
|
116838
|
+
if (updated) {
|
|
116839
|
+
returnValue = updated;
|
|
116840
|
+
}
|
|
116768
116841
|
}
|
|
116769
116842
|
if (isEnclosingDeclaration(input)) {
|
|
116770
116843
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -117273,7 +117346,7 @@ function transformDeclarations(context) {
|
|
|
117273
117346
|
}
|
|
117274
117347
|
}
|
|
117275
117348
|
}
|
|
117276
|
-
function checkName(node) {
|
|
117349
|
+
function checkName(node, returnValue) {
|
|
117277
117350
|
let oldDiag;
|
|
117278
117351
|
if (!suppressNewDiagnosticContexts) {
|
|
117279
117352
|
oldDiag = getSymbolAccessibilityDiagnostic;
|
|
@@ -117283,11 +117356,21 @@ function transformDeclarations(context) {
|
|
|
117283
117356
|
Debug.assert(hasDynamicName(node));
|
|
117284
117357
|
const decl = node;
|
|
117285
117358
|
const entityName = decl.name.expression;
|
|
117286
|
-
|
|
117359
|
+
const nameExpr = isEntityNameExpression(entityName) ? entityName : entityName.expression;
|
|
117360
|
+
checkEntityNameVisibility(nameExpr, enclosingDeclaration);
|
|
117361
|
+
let result = returnValue;
|
|
117362
|
+
if (returnValue && nameExpr !== entityName) {
|
|
117363
|
+
const updated = factory2.updateComputedPropertyName(decl.name, nameExpr);
|
|
117364
|
+
result = factory2.cloneNode(returnValue);
|
|
117365
|
+
result.name = updated;
|
|
117366
|
+
}
|
|
117287
117367
|
if (!suppressNewDiagnosticContexts) {
|
|
117288
117368
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
117289
117369
|
}
|
|
117290
117370
|
errorNameNode = void 0;
|
|
117371
|
+
if (result !== returnValue) {
|
|
117372
|
+
return result;
|
|
117373
|
+
}
|
|
117291
117374
|
}
|
|
117292
117375
|
function shouldStripInternal(node) {
|
|
117293
117376
|
return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile);
|
|
@@ -180254,6 +180337,7 @@ __export(ts_exports2, {
|
|
|
180254
180337
|
isRootedDiskPath: () => isRootedDiskPath,
|
|
180255
180338
|
isSameEntityName: () => isSameEntityName,
|
|
180256
180339
|
isSatisfiesExpression: () => isSatisfiesExpression,
|
|
180340
|
+
isSatisfiesKeyofExpression: () => isSatisfiesKeyofExpression,
|
|
180257
180341
|
isScopeMarker: () => isScopeMarker,
|
|
180258
180342
|
isSemicolonClassElement: () => isSemicolonClassElement,
|
|
180259
180343
|
isSetAccessor: () => isSetAccessor,
|
|
@@ -194690,6 +194774,7 @@ if (typeof console !== "undefined") {
|
|
|
194690
194774
|
isRootedDiskPath,
|
|
194691
194775
|
isSameEntityName,
|
|
194692
194776
|
isSatisfiesExpression,
|
|
194777
|
+
isSatisfiesKeyofExpression,
|
|
194693
194778
|
isScopeMarker,
|
|
194694
194779
|
isSemicolonClassElement,
|
|
194695
194780
|
isSetAccessor,
|
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.6.0-pr-
|
|
5
|
+
"version": "5.6.0-pr-58829-3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|