@typescript-deploys/pr-build 5.1.0-pr-51196-8 → 5.1.0-pr-53268-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +47 -51
- package/lib/tsserver.js +47 -51
- package/lib/tsserverlibrary.js +47 -51
- package/lib/typescript.js +47 -51
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -45969,6 +45969,10 @@ function createTypeChecker(host) {
|
|
|
45969
45969
|
return;
|
|
45970
45970
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
45971
45971
|
});
|
|
45972
|
+
if (merged === exported) {
|
|
45973
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
45974
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
45975
|
+
}
|
|
45972
45976
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
45973
45977
|
return links.cjsExportMerged = merged;
|
|
45974
45978
|
}
|
|
@@ -49422,7 +49426,8 @@ function createTypeChecker(host) {
|
|
|
49422
49426
|
), modifierFlags);
|
|
49423
49427
|
}
|
|
49424
49428
|
function getNamespaceMembersForSerialization(symbol) {
|
|
49425
|
-
|
|
49429
|
+
const exports = getExportsOfSymbol(symbol);
|
|
49430
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
49426
49431
|
}
|
|
49427
49432
|
function isTypeOnlyNamespace(symbol) {
|
|
49428
49433
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -53225,9 +53230,10 @@ function createTypeChecker(host) {
|
|
|
53225
53230
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
53226
53231
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
53227
53232
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
53228
|
-
const
|
|
53229
|
-
const
|
|
53230
|
-
const
|
|
53233
|
+
const mappedType = type.target || type;
|
|
53234
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
53235
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
53236
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
53231
53237
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
53232
53238
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
53233
53239
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -53264,7 +53270,7 @@ function createTypeChecker(host) {
|
|
|
53264
53270
|
prop.links.keyType = keyType;
|
|
53265
53271
|
if (modifiersProp) {
|
|
53266
53272
|
prop.links.syntheticOrigin = modifiersProp;
|
|
53267
|
-
prop.declarations =
|
|
53273
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
53268
53274
|
}
|
|
53269
53275
|
members.set(propName, prop);
|
|
53270
53276
|
}
|
|
@@ -53370,6 +53376,10 @@ function createTypeChecker(host) {
|
|
|
53370
53376
|
}
|
|
53371
53377
|
return false;
|
|
53372
53378
|
}
|
|
53379
|
+
function isFilteringMappedType(type) {
|
|
53380
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
53381
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
53382
|
+
}
|
|
53373
53383
|
function resolveStructuredTypeMembers(type) {
|
|
53374
53384
|
if (!type.members) {
|
|
53375
53385
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -53729,7 +53739,7 @@ function createTypeChecker(host) {
|
|
|
53729
53739
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
53730
53740
|
if (typeVariable && !type.declaration.nameType) {
|
|
53731
53741
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
53732
|
-
if (constraint &&
|
|
53742
|
+
if (constraint && isArrayType(constraint)) {
|
|
53733
53743
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
53734
53744
|
}
|
|
53735
53745
|
}
|
|
@@ -56909,8 +56919,7 @@ function createTypeChecker(host) {
|
|
|
56909
56919
|
}
|
|
56910
56920
|
}
|
|
56911
56921
|
if (isGenericMappedType(objectType)) {
|
|
56912
|
-
|
|
56913
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
56922
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
56914
56923
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
56915
56924
|
}
|
|
56916
56925
|
}
|
|
@@ -66397,21 +66406,7 @@ function createTypeChecker(host) {
|
|
|
66397
66406
|
}
|
|
66398
66407
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
66399
66408
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
66400
|
-
|
|
66401
|
-
return filterType(getReturnTypeOfSignature(signature), (returnType2) => {
|
|
66402
|
-
if (functionFlags & 1 /* Generator */) {
|
|
66403
|
-
return checkGeneratorInstantiationAssignabilityToReturnType(
|
|
66404
|
-
returnType2,
|
|
66405
|
-
functionFlags,
|
|
66406
|
-
/*errorNode*/
|
|
66407
|
-
void 0
|
|
66408
|
-
);
|
|
66409
|
-
}
|
|
66410
|
-
if (functionFlags & 2 /* Async */) {
|
|
66411
|
-
return !!getAwaitedTypeOfPromise(returnType2);
|
|
66412
|
-
}
|
|
66413
|
-
return true;
|
|
66414
|
-
});
|
|
66409
|
+
return getReturnTypeOfSignature(signature);
|
|
66415
66410
|
}
|
|
66416
66411
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
66417
66412
|
if (iife) {
|
|
@@ -67669,7 +67664,7 @@ function createTypeChecker(host) {
|
|
|
67669
67664
|
}
|
|
67670
67665
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
67671
67666
|
const attributes = openingLikeElement.attributes;
|
|
67672
|
-
const
|
|
67667
|
+
const contextualType = getContextualType(attributes, 0 /* None */);
|
|
67673
67668
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
67674
67669
|
let attributesTable = createSymbolTable();
|
|
67675
67670
|
let spread = emptyJsxObjectType;
|
|
@@ -67696,12 +67691,18 @@ function createTypeChecker(host) {
|
|
|
67696
67691
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
67697
67692
|
explicitlySpecifyChildrenAttribute = true;
|
|
67698
67693
|
}
|
|
67699
|
-
if (
|
|
67700
|
-
const prop = getPropertyOfType(
|
|
67694
|
+
if (contextualType) {
|
|
67695
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
67701
67696
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
67702
67697
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
67703
67698
|
}
|
|
67704
67699
|
}
|
|
67700
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
67701
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
67702
|
+
Debug.assert(inferenceContext);
|
|
67703
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
67704
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
67705
|
+
}
|
|
67705
67706
|
} else {
|
|
67706
67707
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
67707
67708
|
if (attributesTable.size > 0) {
|
|
@@ -67756,12 +67757,12 @@ function createTypeChecker(host) {
|
|
|
67756
67757
|
if (explicitlySpecifyChildrenAttribute) {
|
|
67757
67758
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
67758
67759
|
}
|
|
67759
|
-
const
|
|
67760
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
67760
67761
|
openingLikeElement.attributes,
|
|
67761
67762
|
/*contextFlags*/
|
|
67762
67763
|
void 0
|
|
67763
67764
|
);
|
|
67764
|
-
const childrenContextualType =
|
|
67765
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
67765
67766
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
67766
67767
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
67767
67768
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -73383,15 +73384,7 @@ function createTypeChecker(host) {
|
|
|
73383
73384
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
73384
73385
|
}
|
|
73385
73386
|
}
|
|
73386
|
-
|
|
73387
|
-
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
73388
|
-
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
73389
|
-
t,
|
|
73390
|
-
functionFlags,
|
|
73391
|
-
/*errorNode*/
|
|
73392
|
-
void 0
|
|
73393
|
-
));
|
|
73394
|
-
}
|
|
73387
|
+
const returnType = getReturnTypeFromAnnotation(func);
|
|
73395
73388
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
73396
73389
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
73397
73390
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -74193,7 +74186,11 @@ function createTypeChecker(host) {
|
|
|
74193
74186
|
if (returnType === voidType) {
|
|
74194
74187
|
error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
74195
74188
|
} else {
|
|
74196
|
-
|
|
74189
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || anyType;
|
|
74190
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
74191
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
74192
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
74193
|
+
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);
|
|
74197
74194
|
}
|
|
74198
74195
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
74199
74196
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
@@ -74204,13 +74201,6 @@ function createTypeChecker(host) {
|
|
|
74204
74201
|
}
|
|
74205
74202
|
}
|
|
74206
74203
|
}
|
|
74207
|
-
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
74208
|
-
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
74209
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
74210
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
74211
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
74212
|
-
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
74213
|
-
}
|
|
74214
74204
|
function checkClassForDuplicateDeclarations(node) {
|
|
74215
74205
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
74216
74206
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -91164,8 +91154,11 @@ function transformESDecorators(context) {
|
|
|
91164
91154
|
false,
|
|
91165
91155
|
visitor
|
|
91166
91156
|
);
|
|
91157
|
+
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
91158
|
+
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
|
|
91159
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
|
|
91167
91160
|
addRange(statements, initializerStatements);
|
|
91168
|
-
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement,
|
|
91161
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
|
|
91169
91162
|
body = factory2.createBlock(
|
|
91170
91163
|
statements,
|
|
91171
91164
|
/*multiLine*/
|
|
@@ -103957,7 +103950,7 @@ function transformNodeModule(context) {
|
|
|
103957
103950
|
|
|
103958
103951
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
103959
103952
|
function canProduceDiagnostics(node) {
|
|
103960
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
103953
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
103961
103954
|
}
|
|
103962
103955
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
103963
103956
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -104003,7 +103996,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
|
104003
103996
|
}
|
|
104004
103997
|
}
|
|
104005
103998
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
104006
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
103999
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
104007
104000
|
return getVariableDeclarationTypeVisibilityError;
|
|
104008
104001
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
104009
104002
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -104028,7 +104021,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
104028
104021
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
104029
104022
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
104030
104023
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
104031
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
104024
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
104032
104025
|
if (isStatic(node)) {
|
|
104033
104026
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
104034
104027
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -105481,13 +105474,16 @@ function transformDeclarations(context) {
|
|
|
105481
105474
|
fakespace.symbol = props[0].parent;
|
|
105482
105475
|
const exportMappings = [];
|
|
105483
105476
|
let declarations = mapDefined(props, (p) => {
|
|
105484
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
105477
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
105478
|
+
return void 0;
|
|
105479
|
+
}
|
|
105480
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105481
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
105485
105482
|
return void 0;
|
|
105486
105483
|
}
|
|
105487
105484
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
105488
105485
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
105489
105486
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
105490
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
105491
105487
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
105492
105488
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
105493
105489
|
if (isNonContextualKeywordName) {
|
package/lib/tsserver.js
CHANGED
|
@@ -50566,6 +50566,10 @@ function createTypeChecker(host) {
|
|
|
50566
50566
|
return;
|
|
50567
50567
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
50568
50568
|
});
|
|
50569
|
+
if (merged === exported) {
|
|
50570
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
50571
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
50572
|
+
}
|
|
50569
50573
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
50570
50574
|
return links.cjsExportMerged = merged;
|
|
50571
50575
|
}
|
|
@@ -54019,7 +54023,8 @@ function createTypeChecker(host) {
|
|
|
54019
54023
|
), modifierFlags);
|
|
54020
54024
|
}
|
|
54021
54025
|
function getNamespaceMembersForSerialization(symbol) {
|
|
54022
|
-
|
|
54026
|
+
const exports = getExportsOfSymbol(symbol);
|
|
54027
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
54023
54028
|
}
|
|
54024
54029
|
function isTypeOnlyNamespace(symbol) {
|
|
54025
54030
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -57822,9 +57827,10 @@ function createTypeChecker(host) {
|
|
|
57822
57827
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
57823
57828
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
57824
57829
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
57825
|
-
const
|
|
57826
|
-
const
|
|
57827
|
-
const
|
|
57830
|
+
const mappedType = type.target || type;
|
|
57831
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
57832
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
57833
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
57828
57834
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
57829
57835
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
57830
57836
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -57861,7 +57867,7 @@ function createTypeChecker(host) {
|
|
|
57861
57867
|
prop.links.keyType = keyType;
|
|
57862
57868
|
if (modifiersProp) {
|
|
57863
57869
|
prop.links.syntheticOrigin = modifiersProp;
|
|
57864
|
-
prop.declarations =
|
|
57870
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
57865
57871
|
}
|
|
57866
57872
|
members.set(propName, prop);
|
|
57867
57873
|
}
|
|
@@ -57967,6 +57973,10 @@ function createTypeChecker(host) {
|
|
|
57967
57973
|
}
|
|
57968
57974
|
return false;
|
|
57969
57975
|
}
|
|
57976
|
+
function isFilteringMappedType(type) {
|
|
57977
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
57978
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
57979
|
+
}
|
|
57970
57980
|
function resolveStructuredTypeMembers(type) {
|
|
57971
57981
|
if (!type.members) {
|
|
57972
57982
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -58326,7 +58336,7 @@ function createTypeChecker(host) {
|
|
|
58326
58336
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
58327
58337
|
if (typeVariable && !type.declaration.nameType) {
|
|
58328
58338
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
58329
|
-
if (constraint &&
|
|
58339
|
+
if (constraint && isArrayType(constraint)) {
|
|
58330
58340
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
58331
58341
|
}
|
|
58332
58342
|
}
|
|
@@ -61506,8 +61516,7 @@ function createTypeChecker(host) {
|
|
|
61506
61516
|
}
|
|
61507
61517
|
}
|
|
61508
61518
|
if (isGenericMappedType(objectType)) {
|
|
61509
|
-
|
|
61510
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
61519
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
61511
61520
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
61512
61521
|
}
|
|
61513
61522
|
}
|
|
@@ -70994,21 +71003,7 @@ function createTypeChecker(host) {
|
|
|
70994
71003
|
}
|
|
70995
71004
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
70996
71005
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
70997
|
-
|
|
70998
|
-
return filterType(getReturnTypeOfSignature(signature), (returnType2) => {
|
|
70999
|
-
if (functionFlags & 1 /* Generator */) {
|
|
71000
|
-
return checkGeneratorInstantiationAssignabilityToReturnType(
|
|
71001
|
-
returnType2,
|
|
71002
|
-
functionFlags,
|
|
71003
|
-
/*errorNode*/
|
|
71004
|
-
void 0
|
|
71005
|
-
);
|
|
71006
|
-
}
|
|
71007
|
-
if (functionFlags & 2 /* Async */) {
|
|
71008
|
-
return !!getAwaitedTypeOfPromise(returnType2);
|
|
71009
|
-
}
|
|
71010
|
-
return true;
|
|
71011
|
-
});
|
|
71006
|
+
return getReturnTypeOfSignature(signature);
|
|
71012
71007
|
}
|
|
71013
71008
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
71014
71009
|
if (iife) {
|
|
@@ -72266,7 +72261,7 @@ function createTypeChecker(host) {
|
|
|
72266
72261
|
}
|
|
72267
72262
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
72268
72263
|
const attributes = openingLikeElement.attributes;
|
|
72269
|
-
const
|
|
72264
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
72270
72265
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
72271
72266
|
let attributesTable = createSymbolTable();
|
|
72272
72267
|
let spread = emptyJsxObjectType;
|
|
@@ -72293,12 +72288,18 @@ function createTypeChecker(host) {
|
|
|
72293
72288
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
72294
72289
|
explicitlySpecifyChildrenAttribute = true;
|
|
72295
72290
|
}
|
|
72296
|
-
if (
|
|
72297
|
-
const prop = getPropertyOfType(
|
|
72291
|
+
if (contextualType) {
|
|
72292
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
72298
72293
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
72299
72294
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
72300
72295
|
}
|
|
72301
72296
|
}
|
|
72297
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
72298
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
72299
|
+
Debug.assert(inferenceContext);
|
|
72300
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
72301
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
72302
|
+
}
|
|
72302
72303
|
} else {
|
|
72303
72304
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
72304
72305
|
if (attributesTable.size > 0) {
|
|
@@ -72353,12 +72354,12 @@ function createTypeChecker(host) {
|
|
|
72353
72354
|
if (explicitlySpecifyChildrenAttribute) {
|
|
72354
72355
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
72355
72356
|
}
|
|
72356
|
-
const
|
|
72357
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
72357
72358
|
openingLikeElement.attributes,
|
|
72358
72359
|
/*contextFlags*/
|
|
72359
72360
|
void 0
|
|
72360
72361
|
);
|
|
72361
|
-
const childrenContextualType =
|
|
72362
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
72362
72363
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
72363
72364
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
72364
72365
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -77980,15 +77981,7 @@ function createTypeChecker(host) {
|
|
|
77980
77981
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
77981
77982
|
}
|
|
77982
77983
|
}
|
|
77983
|
-
|
|
77984
|
-
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
77985
|
-
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
77986
|
-
t,
|
|
77987
|
-
functionFlags,
|
|
77988
|
-
/*errorNode*/
|
|
77989
|
-
void 0
|
|
77990
|
-
));
|
|
77991
|
-
}
|
|
77984
|
+
const returnType = getReturnTypeFromAnnotation(func);
|
|
77992
77985
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
77993
77986
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
77994
77987
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -78790,7 +78783,11 @@ function createTypeChecker(host) {
|
|
|
78790
78783
|
if (returnType === voidType) {
|
|
78791
78784
|
error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
78792
78785
|
} else {
|
|
78793
|
-
|
|
78786
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || anyType;
|
|
78787
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
78788
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
78789
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
78790
|
+
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);
|
|
78794
78791
|
}
|
|
78795
78792
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
78796
78793
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
@@ -78801,13 +78798,6 @@ function createTypeChecker(host) {
|
|
|
78801
78798
|
}
|
|
78802
78799
|
}
|
|
78803
78800
|
}
|
|
78804
|
-
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
78805
|
-
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
78806
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
78807
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
78808
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
78809
|
-
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
78810
|
-
}
|
|
78811
78801
|
function checkClassForDuplicateDeclarations(node) {
|
|
78812
78802
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
78813
78803
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -95932,8 +95922,11 @@ function transformESDecorators(context) {
|
|
|
95932
95922
|
false,
|
|
95933
95923
|
visitor
|
|
95934
95924
|
);
|
|
95925
|
+
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
95926
|
+
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
|
|
95927
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
|
|
95935
95928
|
addRange(statements, initializerStatements);
|
|
95936
|
-
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement,
|
|
95929
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
|
|
95937
95930
|
body = factory2.createBlock(
|
|
95938
95931
|
statements,
|
|
95939
95932
|
/*multiLine*/
|
|
@@ -108725,7 +108718,7 @@ function transformNodeModule(context) {
|
|
|
108725
108718
|
|
|
108726
108719
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
108727
108720
|
function canProduceDiagnostics(node) {
|
|
108728
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
108721
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
108729
108722
|
}
|
|
108730
108723
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
108731
108724
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -108771,7 +108764,7 @@ function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
|
108771
108764
|
}
|
|
108772
108765
|
}
|
|
108773
108766
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
108774
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
108767
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
108775
108768
|
return getVariableDeclarationTypeVisibilityError;
|
|
108776
108769
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
108777
108770
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -108796,7 +108789,7 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
108796
108789
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
108797
108790
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
108798
108791
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
108799
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
108792
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
108800
108793
|
if (isStatic(node)) {
|
|
108801
108794
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
108802
108795
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -110249,13 +110242,16 @@ function transformDeclarations(context) {
|
|
|
110249
110242
|
fakespace.symbol = props[0].parent;
|
|
110250
110243
|
const exportMappings = [];
|
|
110251
110244
|
let declarations = mapDefined(props, (p) => {
|
|
110252
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
110245
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
110246
|
+
return void 0;
|
|
110247
|
+
}
|
|
110248
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
110249
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
110253
110250
|
return void 0;
|
|
110254
110251
|
}
|
|
110255
110252
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
110256
110253
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
110257
110254
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
110258
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
110259
110255
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
110260
110256
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
110261
110257
|
if (isNonContextualKeywordName) {
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -48377,6 +48377,10 @@ ${lanes.join("\n")}
|
|
|
48377
48377
|
return;
|
|
48378
48378
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
48379
48379
|
});
|
|
48380
|
+
if (merged === exported) {
|
|
48381
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
48382
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
48383
|
+
}
|
|
48380
48384
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
48381
48385
|
return links.cjsExportMerged = merged;
|
|
48382
48386
|
}
|
|
@@ -51830,7 +51834,8 @@ ${lanes.join("\n")}
|
|
|
51830
51834
|
), modifierFlags);
|
|
51831
51835
|
}
|
|
51832
51836
|
function getNamespaceMembersForSerialization(symbol) {
|
|
51833
|
-
|
|
51837
|
+
const exports = getExportsOfSymbol(symbol);
|
|
51838
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
51834
51839
|
}
|
|
51835
51840
|
function isTypeOnlyNamespace(symbol) {
|
|
51836
51841
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55633,9 +55638,10 @@ ${lanes.join("\n")}
|
|
|
55633
55638
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
55634
55639
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55635
55640
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55636
|
-
const
|
|
55637
|
-
const
|
|
55638
|
-
const
|
|
55641
|
+
const mappedType = type.target || type;
|
|
55642
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
55643
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
55644
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
55639
55645
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55640
55646
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
55641
55647
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -55672,7 +55678,7 @@ ${lanes.join("\n")}
|
|
|
55672
55678
|
prop.links.keyType = keyType;
|
|
55673
55679
|
if (modifiersProp) {
|
|
55674
55680
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55675
|
-
prop.declarations =
|
|
55681
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
55676
55682
|
}
|
|
55677
55683
|
members.set(propName, prop);
|
|
55678
55684
|
}
|
|
@@ -55778,6 +55784,10 @@ ${lanes.join("\n")}
|
|
|
55778
55784
|
}
|
|
55779
55785
|
return false;
|
|
55780
55786
|
}
|
|
55787
|
+
function isFilteringMappedType(type) {
|
|
55788
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
55789
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
55790
|
+
}
|
|
55781
55791
|
function resolveStructuredTypeMembers(type) {
|
|
55782
55792
|
if (!type.members) {
|
|
55783
55793
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -56137,7 +56147,7 @@ ${lanes.join("\n")}
|
|
|
56137
56147
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
56138
56148
|
if (typeVariable && !type.declaration.nameType) {
|
|
56139
56149
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
56140
|
-
if (constraint &&
|
|
56150
|
+
if (constraint && isArrayType(constraint)) {
|
|
56141
56151
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
56142
56152
|
}
|
|
56143
56153
|
}
|
|
@@ -59317,8 +59327,7 @@ ${lanes.join("\n")}
|
|
|
59317
59327
|
}
|
|
59318
59328
|
}
|
|
59319
59329
|
if (isGenericMappedType(objectType)) {
|
|
59320
|
-
|
|
59321
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
59330
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
59322
59331
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
59323
59332
|
}
|
|
59324
59333
|
}
|
|
@@ -68805,21 +68814,7 @@ ${lanes.join("\n")}
|
|
|
68805
68814
|
}
|
|
68806
68815
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
68807
68816
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
68808
|
-
|
|
68809
|
-
return filterType(getReturnTypeOfSignature(signature), (returnType2) => {
|
|
68810
|
-
if (functionFlags & 1 /* Generator */) {
|
|
68811
|
-
return checkGeneratorInstantiationAssignabilityToReturnType(
|
|
68812
|
-
returnType2,
|
|
68813
|
-
functionFlags,
|
|
68814
|
-
/*errorNode*/
|
|
68815
|
-
void 0
|
|
68816
|
-
);
|
|
68817
|
-
}
|
|
68818
|
-
if (functionFlags & 2 /* Async */) {
|
|
68819
|
-
return !!getAwaitedTypeOfPromise(returnType2);
|
|
68820
|
-
}
|
|
68821
|
-
return true;
|
|
68822
|
-
});
|
|
68817
|
+
return getReturnTypeOfSignature(signature);
|
|
68823
68818
|
}
|
|
68824
68819
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
68825
68820
|
if (iife) {
|
|
@@ -70077,7 +70072,7 @@ ${lanes.join("\n")}
|
|
|
70077
70072
|
}
|
|
70078
70073
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
70079
70074
|
const attributes = openingLikeElement.attributes;
|
|
70080
|
-
const
|
|
70075
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
70081
70076
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
70082
70077
|
let attributesTable = createSymbolTable();
|
|
70083
70078
|
let spread = emptyJsxObjectType;
|
|
@@ -70104,12 +70099,18 @@ ${lanes.join("\n")}
|
|
|
70104
70099
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
70105
70100
|
explicitlySpecifyChildrenAttribute = true;
|
|
70106
70101
|
}
|
|
70107
|
-
if (
|
|
70108
|
-
const prop = getPropertyOfType(
|
|
70102
|
+
if (contextualType) {
|
|
70103
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
70109
70104
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
70110
70105
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70111
70106
|
}
|
|
70112
70107
|
}
|
|
70108
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
70109
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
70110
|
+
Debug.assert(inferenceContext);
|
|
70111
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
70112
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
70113
|
+
}
|
|
70113
70114
|
} else {
|
|
70114
70115
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
70115
70116
|
if (attributesTable.size > 0) {
|
|
@@ -70164,12 +70165,12 @@ ${lanes.join("\n")}
|
|
|
70164
70165
|
if (explicitlySpecifyChildrenAttribute) {
|
|
70165
70166
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
70166
70167
|
}
|
|
70167
|
-
const
|
|
70168
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
70168
70169
|
openingLikeElement.attributes,
|
|
70169
70170
|
/*contextFlags*/
|
|
70170
70171
|
void 0
|
|
70171
70172
|
);
|
|
70172
|
-
const childrenContextualType =
|
|
70173
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
70173
70174
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
70174
70175
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
70175
70176
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -75791,15 +75792,7 @@ ${lanes.join("\n")}
|
|
|
75791
75792
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
75792
75793
|
}
|
|
75793
75794
|
}
|
|
75794
|
-
|
|
75795
|
-
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
75796
|
-
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
75797
|
-
t,
|
|
75798
|
-
functionFlags,
|
|
75799
|
-
/*errorNode*/
|
|
75800
|
-
void 0
|
|
75801
|
-
));
|
|
75802
|
-
}
|
|
75795
|
+
const returnType = getReturnTypeFromAnnotation(func);
|
|
75803
75796
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
75804
75797
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
75805
75798
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -76601,7 +76594,11 @@ ${lanes.join("\n")}
|
|
|
76601
76594
|
if (returnType === voidType) {
|
|
76602
76595
|
error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
76603
76596
|
} else {
|
|
76604
|
-
|
|
76597
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || anyType;
|
|
76598
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
76599
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
76600
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
76601
|
+
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);
|
|
76605
76602
|
}
|
|
76606
76603
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
76607
76604
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
@@ -76612,13 +76609,6 @@ ${lanes.join("\n")}
|
|
|
76612
76609
|
}
|
|
76613
76610
|
}
|
|
76614
76611
|
}
|
|
76615
|
-
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
76616
|
-
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
76617
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
76618
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
76619
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
76620
|
-
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
76621
|
-
}
|
|
76622
76612
|
function checkClassForDuplicateDeclarations(node) {
|
|
76623
76613
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
76624
76614
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -93936,8 +93926,11 @@ ${lanes.join("\n")}
|
|
|
93936
93926
|
false,
|
|
93937
93927
|
visitor
|
|
93938
93928
|
);
|
|
93929
|
+
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
93930
|
+
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
|
|
93931
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
|
|
93939
93932
|
addRange(statements, initializerStatements);
|
|
93940
|
-
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement,
|
|
93933
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
|
|
93941
93934
|
body = factory2.createBlock(
|
|
93942
93935
|
statements,
|
|
93943
93936
|
/*multiLine*/
|
|
@@ -106827,7 +106820,7 @@ ${lanes.join("\n")}
|
|
|
106827
106820
|
|
|
106828
106821
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
106829
106822
|
function canProduceDiagnostics(node) {
|
|
106830
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
106823
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
106831
106824
|
}
|
|
106832
106825
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
106833
106826
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -106873,7 +106866,7 @@ ${lanes.join("\n")}
|
|
|
106873
106866
|
}
|
|
106874
106867
|
}
|
|
106875
106868
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
106876
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106869
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106877
106870
|
return getVariableDeclarationTypeVisibilityError;
|
|
106878
106871
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
106879
106872
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -106898,7 +106891,7 @@ ${lanes.join("\n")}
|
|
|
106898
106891
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106899
106892
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
106900
106893
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
106901
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106894
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106902
106895
|
if (isStatic(node)) {
|
|
106903
106896
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
106904
106897
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -108356,13 +108349,16 @@ ${lanes.join("\n")}
|
|
|
108356
108349
|
fakespace.symbol = props[0].parent;
|
|
108357
108350
|
const exportMappings = [];
|
|
108358
108351
|
let declarations = mapDefined(props, (p) => {
|
|
108359
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
108352
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
108353
|
+
return void 0;
|
|
108354
|
+
}
|
|
108355
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108356
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
108360
108357
|
return void 0;
|
|
108361
108358
|
}
|
|
108362
108359
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
108363
108360
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
108364
108361
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108365
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108366
108362
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
108367
108363
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
108368
108364
|
if (isNonContextualKeywordName) {
|
package/lib/typescript.js
CHANGED
|
@@ -48377,6 +48377,10 @@ ${lanes.join("\n")}
|
|
|
48377
48377
|
return;
|
|
48378
48378
|
merged.exports.set(name, merged.exports.has(name) ? mergeSymbol(merged.exports.get(name), s) : s);
|
|
48379
48379
|
});
|
|
48380
|
+
if (merged === exported) {
|
|
48381
|
+
getSymbolLinks(merged).resolvedExports = void 0;
|
|
48382
|
+
getSymbolLinks(merged).resolvedMembers = void 0;
|
|
48383
|
+
}
|
|
48380
48384
|
getSymbolLinks(merged).cjsExportMerged = merged;
|
|
48381
48385
|
return links.cjsExportMerged = merged;
|
|
48382
48386
|
}
|
|
@@ -51830,7 +51834,8 @@ ${lanes.join("\n")}
|
|
|
51830
51834
|
), modifierFlags);
|
|
51831
51835
|
}
|
|
51832
51836
|
function getNamespaceMembersForSerialization(symbol) {
|
|
51833
|
-
|
|
51837
|
+
const exports = getExportsOfSymbol(symbol);
|
|
51838
|
+
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
51834
51839
|
}
|
|
51835
51840
|
function isTypeOnlyNamespace(symbol) {
|
|
51836
51841
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -55633,9 +55638,10 @@ ${lanes.join("\n")}
|
|
|
55633
55638
|
setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
55634
55639
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55635
55640
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55636
|
-
const
|
|
55637
|
-
const
|
|
55638
|
-
const
|
|
55641
|
+
const mappedType = type.target || type;
|
|
55642
|
+
const nameType = getNameTypeFromMappedType(mappedType);
|
|
55643
|
+
const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
|
|
55644
|
+
const templateType = getTemplateTypeFromMappedType(mappedType);
|
|
55639
55645
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55640
55646
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
55641
55647
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
@@ -55672,7 +55678,7 @@ ${lanes.join("\n")}
|
|
|
55672
55678
|
prop.links.keyType = keyType;
|
|
55673
55679
|
if (modifiersProp) {
|
|
55674
55680
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55675
|
-
prop.declarations =
|
|
55681
|
+
prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
|
|
55676
55682
|
}
|
|
55677
55683
|
members.set(propName, prop);
|
|
55678
55684
|
}
|
|
@@ -55778,6 +55784,10 @@ ${lanes.join("\n")}
|
|
|
55778
55784
|
}
|
|
55779
55785
|
return false;
|
|
55780
55786
|
}
|
|
55787
|
+
function isFilteringMappedType(type) {
|
|
55788
|
+
const nameType = getNameTypeFromMappedType(type);
|
|
55789
|
+
return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
|
|
55790
|
+
}
|
|
55781
55791
|
function resolveStructuredTypeMembers(type) {
|
|
55782
55792
|
if (!type.members) {
|
|
55783
55793
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -56137,7 +56147,7 @@ ${lanes.join("\n")}
|
|
|
56137
56147
|
const typeVariable = getHomomorphicTypeVariable(type);
|
|
56138
56148
|
if (typeVariable && !type.declaration.nameType) {
|
|
56139
56149
|
const constraint = getConstraintOfTypeParameter(typeVariable);
|
|
56140
|
-
if (constraint &&
|
|
56150
|
+
if (constraint && isArrayType(constraint)) {
|
|
56141
56151
|
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
|
|
56142
56152
|
}
|
|
56143
56153
|
}
|
|
@@ -59317,8 +59327,7 @@ ${lanes.join("\n")}
|
|
|
59317
59327
|
}
|
|
59318
59328
|
}
|
|
59319
59329
|
if (isGenericMappedType(objectType)) {
|
|
59320
|
-
|
|
59321
|
-
if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
|
|
59330
|
+
if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
|
|
59322
59331
|
return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
|
|
59323
59332
|
}
|
|
59324
59333
|
}
|
|
@@ -68805,21 +68814,7 @@ ${lanes.join("\n")}
|
|
|
68805
68814
|
}
|
|
68806
68815
|
const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl);
|
|
68807
68816
|
if (signature && !isResolvingReturnTypeOfSignature(signature)) {
|
|
68808
|
-
|
|
68809
|
-
return filterType(getReturnTypeOfSignature(signature), (returnType2) => {
|
|
68810
|
-
if (functionFlags & 1 /* Generator */) {
|
|
68811
|
-
return checkGeneratorInstantiationAssignabilityToReturnType(
|
|
68812
|
-
returnType2,
|
|
68813
|
-
functionFlags,
|
|
68814
|
-
/*errorNode*/
|
|
68815
|
-
void 0
|
|
68816
|
-
);
|
|
68817
|
-
}
|
|
68818
|
-
if (functionFlags & 2 /* Async */) {
|
|
68819
|
-
return !!getAwaitedTypeOfPromise(returnType2);
|
|
68820
|
-
}
|
|
68821
|
-
return true;
|
|
68822
|
-
});
|
|
68817
|
+
return getReturnTypeOfSignature(signature);
|
|
68823
68818
|
}
|
|
68824
68819
|
const iife = getImmediatelyInvokedFunctionExpression(functionDecl);
|
|
68825
68820
|
if (iife) {
|
|
@@ -70077,7 +70072,7 @@ ${lanes.join("\n")}
|
|
|
70077
70072
|
}
|
|
70078
70073
|
function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
|
|
70079
70074
|
const attributes = openingLikeElement.attributes;
|
|
70080
|
-
const
|
|
70075
|
+
const contextualType = getContextualType2(attributes, 0 /* None */);
|
|
70081
70076
|
const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
70082
70077
|
let attributesTable = createSymbolTable();
|
|
70083
70078
|
let spread = emptyJsxObjectType;
|
|
@@ -70104,12 +70099,18 @@ ${lanes.join("\n")}
|
|
|
70104
70099
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
70105
70100
|
explicitlySpecifyChildrenAttribute = true;
|
|
70106
70101
|
}
|
|
70107
|
-
if (
|
|
70108
|
-
const prop = getPropertyOfType(
|
|
70102
|
+
if (contextualType) {
|
|
70103
|
+
const prop = getPropertyOfType(contextualType, member.escapedName);
|
|
70109
70104
|
if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
|
|
70110
70105
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
70111
70106
|
}
|
|
70112
70107
|
}
|
|
70108
|
+
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
|
|
70109
|
+
const inferenceContext = getInferenceContext(attributes);
|
|
70110
|
+
Debug.assert(inferenceContext);
|
|
70111
|
+
const inferenceNode = attributeDecl.initializer.expression;
|
|
70112
|
+
addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType);
|
|
70113
|
+
}
|
|
70113
70114
|
} else {
|
|
70114
70115
|
Debug.assert(attributeDecl.kind === 291 /* JsxSpreadAttribute */);
|
|
70115
70116
|
if (attributesTable.size > 0) {
|
|
@@ -70164,12 +70165,12 @@ ${lanes.join("\n")}
|
|
|
70164
70165
|
if (explicitlySpecifyChildrenAttribute) {
|
|
70165
70166
|
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName));
|
|
70166
70167
|
}
|
|
70167
|
-
const
|
|
70168
|
+
const contextualType2 = getApparentTypeOfContextualType(
|
|
70168
70169
|
openingLikeElement.attributes,
|
|
70169
70170
|
/*contextFlags*/
|
|
70170
70171
|
void 0
|
|
70171
70172
|
);
|
|
70172
|
-
const childrenContextualType =
|
|
70173
|
+
const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName);
|
|
70173
70174
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
70174
70175
|
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
70175
70176
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(
|
|
@@ -75791,15 +75792,7 @@ ${lanes.join("\n")}
|
|
|
75791
75792
|
checkExternalEmitHelpers(node, 256 /* Values */);
|
|
75792
75793
|
}
|
|
75793
75794
|
}
|
|
75794
|
-
|
|
75795
|
-
if (returnType && returnType.flags & 1048576 /* Union */) {
|
|
75796
|
-
returnType = filterType(returnType, (t) => checkGeneratorInstantiationAssignabilityToReturnType(
|
|
75797
|
-
t,
|
|
75798
|
-
functionFlags,
|
|
75799
|
-
/*errorNode*/
|
|
75800
|
-
void 0
|
|
75801
|
-
));
|
|
75802
|
-
}
|
|
75795
|
+
const returnType = getReturnTypeFromAnnotation(func);
|
|
75803
75796
|
const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync);
|
|
75804
75797
|
const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType;
|
|
75805
75798
|
const signatureNextType = iterationTypes && iterationTypes.nextType || anyType;
|
|
@@ -76601,7 +76594,11 @@ ${lanes.join("\n")}
|
|
|
76601
76594
|
if (returnType === voidType) {
|
|
76602
76595
|
error(returnTypeNode, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
|
76603
76596
|
} else {
|
|
76604
|
-
|
|
76597
|
+
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || anyType;
|
|
76598
|
+
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || generatorYieldType;
|
|
76599
|
+
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags2 & 2 /* Async */) !== 0) || unknownType;
|
|
76600
|
+
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags2 & 2 /* Async */));
|
|
76601
|
+
checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode);
|
|
76605
76602
|
}
|
|
76606
76603
|
} else if ((functionFlags2 & 3 /* AsyncGenerator */) === 2 /* Async */) {
|
|
76607
76604
|
checkAsyncFunctionReturnType(node, returnTypeNode);
|
|
@@ -76612,13 +76609,6 @@ ${lanes.join("\n")}
|
|
|
76612
76609
|
}
|
|
76613
76610
|
}
|
|
76614
76611
|
}
|
|
76615
|
-
function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) {
|
|
76616
|
-
const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, returnType, (functionFlags & 2 /* Async */) !== 0) || anyType;
|
|
76617
|
-
const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, returnType, (functionFlags & 2 /* Async */) !== 0) || generatorYieldType;
|
|
76618
|
-
const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2 /* Next */, returnType, (functionFlags & 2 /* Async */) !== 0) || unknownType;
|
|
76619
|
-
const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2 /* Async */));
|
|
76620
|
-
return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode);
|
|
76621
|
-
}
|
|
76622
76612
|
function checkClassForDuplicateDeclarations(node) {
|
|
76623
76613
|
const instanceNames = /* @__PURE__ */ new Map();
|
|
76624
76614
|
const staticNames = /* @__PURE__ */ new Map();
|
|
@@ -93936,8 +93926,11 @@ ${lanes.join("\n")}
|
|
|
93936
93926
|
false,
|
|
93937
93927
|
visitor
|
|
93938
93928
|
);
|
|
93929
|
+
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
93930
|
+
const indexOfFirstStatementAfterSuper = superStatementIndex >= 0 ? superStatementIndex + 1 : void 0;
|
|
93931
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, indexOfFirstStatementAfterSuper ? indexOfFirstStatementAfterSuper - nonPrologueStart : void 0));
|
|
93939
93932
|
addRange(statements, initializerStatements);
|
|
93940
|
-
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement,
|
|
93933
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, indexOfFirstStatementAfterSuper));
|
|
93941
93934
|
body = factory2.createBlock(
|
|
93942
93935
|
statements,
|
|
93943
93936
|
/*multiLine*/
|
|
@@ -106827,7 +106820,7 @@ ${lanes.join("\n")}
|
|
|
106827
106820
|
|
|
106828
106821
|
// src/compiler/transformers/declarations/diagnostics.ts
|
|
106829
106822
|
function canProduceDiagnostics(node) {
|
|
106830
|
-
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isJSDocTypeAlias(node);
|
|
106823
|
+
return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node);
|
|
106831
106824
|
}
|
|
106832
106825
|
function createGetSymbolAccessibilityDiagnosticForNodeName(node) {
|
|
106833
106826
|
if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
@@ -106873,7 +106866,7 @@ ${lanes.join("\n")}
|
|
|
106873
106866
|
}
|
|
106874
106867
|
}
|
|
106875
106868
|
function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
106876
|
-
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106869
|
+
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
|
|
106877
106870
|
return getVariableDeclarationTypeVisibilityError;
|
|
106878
106871
|
} else if (isSetAccessor(node) || isGetAccessor(node)) {
|
|
106879
106872
|
return getAccessorDeclarationTypeVisibilityError;
|
|
@@ -106898,7 +106891,7 @@ ${lanes.join("\n")}
|
|
|
106898
106891
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106899
106892
|
if (node.kind === 258 /* VariableDeclaration */ || node.kind === 206 /* BindingElement */) {
|
|
106900
106893
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
106901
|
-
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106894
|
+
} else if (node.kind === 170 /* PropertyDeclaration */ || node.kind === 209 /* PropertyAccessExpression */ || node.kind === 210 /* ElementAccessExpression */ || node.kind === 224 /* BinaryExpression */ || node.kind === 169 /* PropertySignature */ || node.kind === 167 /* Parameter */ && hasSyntacticModifier(node.parent, 8 /* Private */)) {
|
|
106902
106895
|
if (isStatic(node)) {
|
|
106903
106896
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1;
|
|
106904
106897
|
} else if (node.parent.kind === 261 /* ClassDeclaration */ || node.kind === 167 /* Parameter */) {
|
|
@@ -108356,13 +108349,16 @@ ${lanes.join("\n")}
|
|
|
108356
108349
|
fakespace.symbol = props[0].parent;
|
|
108357
108350
|
const exportMappings = [];
|
|
108358
108351
|
let declarations = mapDefined(props, (p) => {
|
|
108359
|
-
if (!p.valueDeclaration || !isPropertyAccessExpression(p.valueDeclaration)) {
|
|
108352
|
+
if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
|
|
108353
|
+
return void 0;
|
|
108354
|
+
}
|
|
108355
|
+
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108356
|
+
if (!isIdentifierText(nameStr, 99 /* ESNext */)) {
|
|
108360
108357
|
return void 0;
|
|
108361
108358
|
}
|
|
108362
108359
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
|
|
108363
108360
|
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
108364
108361
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108365
|
-
const nameStr = unescapeLeadingUnderscores(p.escapedName);
|
|
108366
108362
|
const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr);
|
|
108367
108363
|
const name = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p.valueDeclaration) : factory2.createIdentifier(nameStr);
|
|
108368
108364
|
if (isNonContextualKeywordName) {
|
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.1.0-pr-
|
|
5
|
+
"version": "5.1.0-pr-53268-4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "14.21.1",
|
|
115
115
|
"npm": "8.19.3"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "2beae62ff61bf7a01490690d001dc20434fb14bd"
|
|
118
118
|
}
|