typescript 4.7.0-dev.20220303 → 4.7.0-dev.20220306
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/cs/diagnosticMessages.generated.json +3 -0
- package/lib/de/diagnosticMessages.generated.json +3 -0
- package/lib/es/diagnosticMessages.generated.json +3 -0
- package/lib/fr/diagnosticMessages.generated.json +3 -0
- package/lib/it/diagnosticMessages.generated.json +3 -0
- package/lib/ja/diagnosticMessages.generated.json +3 -0
- package/lib/ko/diagnosticMessages.generated.json +3 -0
- package/lib/lib.es2015.reflect.d.ts +1 -1
- package/lib/lib.es2020.intl.d.ts +1 -1
- package/lib/lib.es5.d.ts +6 -0
- package/lib/pl/diagnosticMessages.generated.json +3 -0
- package/lib/pt-br/diagnosticMessages.generated.json +3 -0
- package/lib/ru/diagnosticMessages.generated.json +3 -0
- package/lib/tr/diagnosticMessages.generated.json +3 -0
- package/lib/tsc.js +126 -31
- package/lib/tsserver.js +131 -34
- package/lib/tsserverlibrary.js +131 -34
- package/lib/typescript.js +131 -34
- package/lib/typescriptServices.js +131 -34
- package/lib/typingsInstaller.js +127 -32
- package/lib/zh-cn/diagnosticMessages.generated.json +3 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +3 -0
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220306";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -39225,7 +39225,8 @@ var ts;
|
|
|
39225
39225
|
name: "jsxFragmentFactory",
|
|
39226
39226
|
type: "string",
|
|
39227
39227
|
category: ts.Diagnostics.Language_and_Environment,
|
|
39228
|
-
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment
|
|
39228
|
+
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,
|
|
39229
|
+
defaultValueDescription: "React.Fragment",
|
|
39229
39230
|
},
|
|
39230
39231
|
{
|
|
39231
39232
|
name: "jsxImportSource",
|
|
@@ -44314,7 +44315,7 @@ var ts;
|
|
|
44314
44315
|
return ts.isDottedName(expr)
|
|
44315
44316
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44316
44317
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44317
|
-
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44318
|
+
|| ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression)
|
|
44318
44319
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44319
44320
|
}
|
|
44320
44321
|
function containsNarrowableReference(expr) {
|
|
@@ -52550,7 +52551,15 @@ var ts;
|
|
|
52550
52551
|
});
|
|
52551
52552
|
}
|
|
52552
52553
|
}
|
|
52553
|
-
if (
|
|
52554
|
+
if (symbolName === undefined) {
|
|
52555
|
+
var name = ts.firstDefined(symbol.declarations, ts.getNameOfDeclaration);
|
|
52556
|
+
if (name && ts.isComputedPropertyName(name) && ts.isEntityName(name.expression)) {
|
|
52557
|
+
var LHS = createAccessFromSymbolChain(chain, index - 1, stopper);
|
|
52558
|
+
if (ts.isEntityName(LHS)) {
|
|
52559
|
+
return ts.factory.createIndexedAccessTypeNode(ts.factory.createParenthesizedType(ts.factory.createTypeQueryNode(LHS)), ts.factory.createTypeQueryNode(name.expression));
|
|
52560
|
+
}
|
|
52561
|
+
return LHS;
|
|
52562
|
+
}
|
|
52554
52563
|
symbolName = getNameOfSymbolAsWritten(symbol, context);
|
|
52555
52564
|
}
|
|
52556
52565
|
context.approximateLength += symbolName.length + 1;
|
|
@@ -65290,7 +65299,7 @@ var ts;
|
|
|
65290
65299
|
var requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source);
|
|
65291
65300
|
var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false);
|
|
65292
65301
|
if (unmatchedProperty) {
|
|
65293
|
-
if (reportErrors) {
|
|
65302
|
+
if (reportErrors && shouldReportUnmatchedPropertyError(source, target)) {
|
|
65294
65303
|
reportUnmatchedProperty(source, target, unmatchedProperty, requireOptionalProperties);
|
|
65295
65304
|
}
|
|
65296
65305
|
return 0 /* False */;
|
|
@@ -65446,6 +65455,19 @@ var ts;
|
|
|
65446
65455
|
}
|
|
65447
65456
|
return result;
|
|
65448
65457
|
}
|
|
65458
|
+
function shouldReportUnmatchedPropertyError(source, target) {
|
|
65459
|
+
var typeCallSignatures = getSignaturesOfStructuredType(source, 0 /* Call */);
|
|
65460
|
+
var typeConstructSignatures = getSignaturesOfStructuredType(source, 1 /* Construct */);
|
|
65461
|
+
var typeProperties = getPropertiesOfObjectType(source);
|
|
65462
|
+
if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) {
|
|
65463
|
+
if ((getSignaturesOfType(target, 0 /* Call */).length && typeCallSignatures.length) ||
|
|
65464
|
+
(getSignaturesOfType(target, 1 /* Construct */).length && typeConstructSignatures.length)) {
|
|
65465
|
+
return true; // target has similar signature kinds to source, still focus on the unmatched property
|
|
65466
|
+
}
|
|
65467
|
+
return false;
|
|
65468
|
+
}
|
|
65469
|
+
return true;
|
|
65470
|
+
}
|
|
65449
65471
|
function reportIncompatibleCallSignatureReturn(siga, sigb) {
|
|
65450
65472
|
if (siga.parameters.length === 0 && sigb.parameters.length === 0) {
|
|
65451
65473
|
return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source), typeToString(target)); };
|
|
@@ -68021,8 +68043,9 @@ var ts;
|
|
|
68021
68043
|
return isMatchingReference(source.expression, target);
|
|
68022
68044
|
case 205 /* PropertyAccessExpression */:
|
|
68023
68045
|
case 206 /* ElementAccessExpression */:
|
|
68024
|
-
|
|
68025
|
-
|
|
68046
|
+
var sourcePropertyName = getAccessedPropertyName(source);
|
|
68047
|
+
var targetPropertyName = ts.isAccessExpression(target) ? getAccessedPropertyName(target) : undefined;
|
|
68048
|
+
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68026
68049
|
isMatchingReference(source.expression, target.expression);
|
|
68027
68050
|
case 160 /* QualifiedName */:
|
|
68028
68051
|
return ts.isAccessExpression(target) &&
|
|
@@ -68034,12 +68057,49 @@ var ts;
|
|
|
68034
68057
|
return false;
|
|
68035
68058
|
}
|
|
68036
68059
|
function getAccessedPropertyName(access) {
|
|
68037
|
-
|
|
68038
|
-
|
|
68039
|
-
|
|
68040
|
-
|
|
68041
|
-
|
|
68042
|
-
|
|
68060
|
+
if (ts.isPropertyAccessExpression(access)) {
|
|
68061
|
+
return access.name.escapedText;
|
|
68062
|
+
}
|
|
68063
|
+
if (ts.isElementAccessExpression(access)) {
|
|
68064
|
+
return tryGetElementAccessExpressionName(access);
|
|
68065
|
+
}
|
|
68066
|
+
if (ts.isBindingElement(access)) {
|
|
68067
|
+
var name = getDestructuringPropertyName(access);
|
|
68068
|
+
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68069
|
+
}
|
|
68070
|
+
if (ts.isParameter(access)) {
|
|
68071
|
+
return ("" + access.parent.parameters.indexOf(access));
|
|
68072
|
+
}
|
|
68073
|
+
return undefined;
|
|
68074
|
+
}
|
|
68075
|
+
function tryGetNameFromType(type) {
|
|
68076
|
+
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68077
|
+
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68078
|
+
}
|
|
68079
|
+
function tryGetElementAccessExpressionName(node) {
|
|
68080
|
+
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68081
|
+
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68082
|
+
}
|
|
68083
|
+
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68084
|
+
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68085
|
+
if (!symbol || !isConstVariable(symbol))
|
|
68086
|
+
return undefined;
|
|
68087
|
+
var declaration = symbol.valueDeclaration;
|
|
68088
|
+
if (declaration === undefined)
|
|
68089
|
+
return undefined;
|
|
68090
|
+
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68091
|
+
if (type) {
|
|
68092
|
+
var name = tryGetNameFromType(type);
|
|
68093
|
+
if (name !== undefined) {
|
|
68094
|
+
return name;
|
|
68095
|
+
}
|
|
68096
|
+
}
|
|
68097
|
+
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68098
|
+
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68099
|
+
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68100
|
+
}
|
|
68101
|
+
}
|
|
68102
|
+
return undefined;
|
|
68043
68103
|
}
|
|
68044
68104
|
function containsMatchingReference(source, target) {
|
|
68045
68105
|
while (ts.isAccessExpression(source)) {
|
|
@@ -71545,11 +71605,21 @@ var ts;
|
|
|
71545
71605
|
}
|
|
71546
71606
|
return false;
|
|
71547
71607
|
}
|
|
71608
|
+
function uniqueStrings(strings) {
|
|
71609
|
+
var unique = new ts.Set(strings);
|
|
71610
|
+
var result = [];
|
|
71611
|
+
unique.forEach(function (str) { return result.push(str); });
|
|
71612
|
+
return result;
|
|
71613
|
+
}
|
|
71548
71614
|
function discriminateContextualTypeByObjectMembers(node, contextualType) {
|
|
71549
|
-
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 295 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(ts.
|
|
71615
|
+
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 295 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(uniqueStrings(ts.flatMap(contextualType.types, function (memberType) {
|
|
71616
|
+
return ts.map(ts.filter(getPropertiesOfType(memberType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return s.escapedName; });
|
|
71617
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71550
71618
|
}
|
|
71551
71619
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
71552
|
-
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(ts.
|
|
71620
|
+
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(uniqueStrings(ts.flatMap(contextualType.types, function (memberType) {
|
|
71621
|
+
return ts.map(ts.filter(getPropertiesOfType(memberType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return s.escapedName; });
|
|
71622
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71553
71623
|
}
|
|
71554
71624
|
// Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
|
|
71555
71625
|
// be "pushed" onto a node using the contextualType property.
|
|
@@ -73044,21 +73114,20 @@ var ts;
|
|
|
73044
73114
|
// of the property as base classes
|
|
73045
73115
|
var enclosingClass = forEachEnclosingClass(location, function (enclosingDeclaration) {
|
|
73046
73116
|
var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration));
|
|
73047
|
-
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing)
|
|
73117
|
+
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73048
73118
|
});
|
|
73049
73119
|
// A protected property is accessible if the property is within the declaring class or classes derived from it
|
|
73050
73120
|
if (!enclosingClass) {
|
|
73051
73121
|
// allow PropertyAccessibility if context is in function with this parameter
|
|
73052
|
-
// static member access is
|
|
73053
|
-
|
|
73054
|
-
|
|
73122
|
+
// static member access is disallowed
|
|
73123
|
+
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
73124
|
+
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73125
|
+
if (flags & 32 /* Static */ || !enclosingClass) {
|
|
73055
73126
|
if (errorNode) {
|
|
73056
73127
|
error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
73057
73128
|
}
|
|
73058
73129
|
return false;
|
|
73059
73130
|
}
|
|
73060
|
-
var thisType = getTypeFromTypeNode(thisParameter.type);
|
|
73061
|
-
enclosingClass = ((thisType.flags & 262144 /* TypeParameter */) ? getConstraintOfTypeParameter(thisType) : thisType).target;
|
|
73062
73131
|
}
|
|
73063
73132
|
// No further restrictions for static properties
|
|
73064
73133
|
if (flags & 32 /* Static */) {
|
|
@@ -73076,6 +73145,17 @@ var ts;
|
|
|
73076
73145
|
}
|
|
73077
73146
|
return true;
|
|
73078
73147
|
}
|
|
73148
|
+
function getEnclosingClassFromThisParameter(node) {
|
|
73149
|
+
var thisParameter = getThisParameterFromNodeContext(node);
|
|
73150
|
+
var thisType = (thisParameter === null || thisParameter === void 0 ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
|
|
73151
|
+
if (thisType && thisType.flags & 262144 /* TypeParameter */) {
|
|
73152
|
+
thisType = getConstraintOfTypeParameter(thisType);
|
|
73153
|
+
}
|
|
73154
|
+
if (thisType && ts.getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
|
|
73155
|
+
return getTargetType(thisType);
|
|
73156
|
+
}
|
|
73157
|
+
return undefined;
|
|
73158
|
+
}
|
|
73079
73159
|
function getThisParameterFromNodeContext(node) {
|
|
73080
73160
|
var thisContainer = ts.getThisContainer(node, /* includeArrowFunctions */ false);
|
|
73081
73161
|
return thisContainer && ts.isFunctionLike(thisContainer) ? ts.getThisParameter(thisContainer) : undefined;
|
|
@@ -75184,7 +75264,7 @@ var ts;
|
|
|
75184
75264
|
// then it cannot be instantiated.
|
|
75185
75265
|
// In the case of a merged class-module or class-interface declaration,
|
|
75186
75266
|
// only the class declaration node will have the Abstract flag set.
|
|
75187
|
-
if (constructSignatures
|
|
75267
|
+
if (someSignature(constructSignatures, function (signature) { return !!(signature.flags & 4 /* Abstract */); })) {
|
|
75188
75268
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
75189
75269
|
return resolveErrorCall(node);
|
|
75190
75270
|
}
|
|
@@ -75215,6 +75295,12 @@ var ts;
|
|
|
75215
75295
|
invocationError(node.expression, expressionType, 1 /* Construct */);
|
|
75216
75296
|
return resolveErrorCall(node);
|
|
75217
75297
|
}
|
|
75298
|
+
function someSignature(signatures, f) {
|
|
75299
|
+
if (ts.isArray(signatures)) {
|
|
75300
|
+
return ts.some(signatures, function (signature) { return someSignature(signature, f); });
|
|
75301
|
+
}
|
|
75302
|
+
return signatures.compositeKind === 1048576 /* Union */ ? ts.some(signatures.compositeSignatures, f) : f(signatures);
|
|
75303
|
+
}
|
|
75218
75304
|
function typeHasProtectedAccessibleBase(target, type) {
|
|
75219
75305
|
var baseTypes = getBaseTypes(type);
|
|
75220
75306
|
if (!ts.length(baseTypes)) {
|
|
@@ -77057,7 +77143,7 @@ var ts;
|
|
|
77057
77143
|
case 40 /* MinusToken */:
|
|
77058
77144
|
case 54 /* TildeToken */:
|
|
77059
77145
|
checkNonNullType(operandType, node.operand);
|
|
77060
|
-
if (
|
|
77146
|
+
if (maybeTypeOfKindConsideringBaseConstraint(operandType, 12288 /* ESSymbolLike */)) {
|
|
77061
77147
|
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
|
|
77062
77148
|
}
|
|
77063
77149
|
if (node.operator === 39 /* PlusToken */) {
|
|
@@ -77105,6 +77191,13 @@ var ts;
|
|
|
77105
77191
|
// If it's not a bigint type, implicit coercion will result in a number
|
|
77106
77192
|
return numberType;
|
|
77107
77193
|
}
|
|
77194
|
+
function maybeTypeOfKindConsideringBaseConstraint(type, kind) {
|
|
77195
|
+
if (maybeTypeOfKind(type, kind)) {
|
|
77196
|
+
return true;
|
|
77197
|
+
}
|
|
77198
|
+
var baseConstraint = getBaseConstraintOrType(type);
|
|
77199
|
+
return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind);
|
|
77200
|
+
}
|
|
77108
77201
|
// Return true if type might be of the given kind. A union or intersection type might be of a given
|
|
77109
77202
|
// kind if at least one constituent type is of the given kind.
|
|
77110
77203
|
function maybeTypeOfKind(type, kind) {
|
|
@@ -77814,8 +77907,8 @@ var ts;
|
|
|
77814
77907
|
}
|
|
77815
77908
|
// Return true if there was no error, false if there was an error.
|
|
77816
77909
|
function checkForDisallowedESSymbolOperand(operator) {
|
|
77817
|
-
var offendingSymbolOperand =
|
|
77818
|
-
|
|
77910
|
+
var offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left :
|
|
77911
|
+
maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right :
|
|
77819
77912
|
undefined;
|
|
77820
77913
|
if (offendingSymbolOperand) {
|
|
77821
77914
|
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
|
|
@@ -78019,7 +78112,7 @@ var ts;
|
|
|
78019
78112
|
for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
|
|
78020
78113
|
var span = _a[_i];
|
|
78021
78114
|
var type = checkExpression(span.expression);
|
|
78022
|
-
if (
|
|
78115
|
+
if (maybeTypeOfKindConsideringBaseConstraint(type, 12288 /* ESSymbolLike */)) {
|
|
78023
78116
|
error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);
|
|
78024
78117
|
}
|
|
78025
78118
|
texts.push(span.literal.text);
|
|
@@ -83046,7 +83139,7 @@ var ts;
|
|
|
83046
83139
|
}
|
|
83047
83140
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83048
83141
|
var propName = member.name;
|
|
83049
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83142
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
83050
83143
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83051
83144
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83052
83145
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83081,7 +83174,9 @@ var ts;
|
|
|
83081
83174
|
return false;
|
|
83082
83175
|
}
|
|
83083
83176
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83084
|
-
var reference = ts.
|
|
83177
|
+
var reference = ts.isComputedPropertyName(propName)
|
|
83178
|
+
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83179
|
+
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83085
83180
|
ts.setParent(reference.expression, reference);
|
|
83086
83181
|
ts.setParent(reference, constructor);
|
|
83087
83182
|
reference.flowNode = constructor.returnFlowNode;
|
|
@@ -92627,6 +92722,9 @@ var ts;
|
|
|
92627
92722
|
function substituteElementAccessExpression(node) {
|
|
92628
92723
|
return substituteConstantValue(node);
|
|
92629
92724
|
}
|
|
92725
|
+
function safeMultiLineComment(value) {
|
|
92726
|
+
return value.replace(/\*\//g, "*_/");
|
|
92727
|
+
}
|
|
92630
92728
|
function substituteConstantValue(node) {
|
|
92631
92729
|
var constantValue = tryGetConstEnumValue(node);
|
|
92632
92730
|
if (constantValue !== undefined) {
|
|
@@ -92635,10 +92733,7 @@ var ts;
|
|
|
92635
92733
|
var substitute = typeof constantValue === "string" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue);
|
|
92636
92734
|
if (!compilerOptions.removeComments) {
|
|
92637
92735
|
var originalNode = ts.getOriginalNode(node, ts.isAccessExpression);
|
|
92638
|
-
|
|
92639
|
-
? ts.declarationNameToString(originalNode.name)
|
|
92640
|
-
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92641
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
|
|
92736
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + safeMultiLineComment(ts.getTextOfNode(originalNode)) + " ");
|
|
92642
92737
|
}
|
|
92643
92738
|
return substitute;
|
|
92644
92739
|
}
|
|
@@ -1539,6 +1539,7 @@
|
|
|
1539
1539
|
"Type_catch_clause_variables_as_unknown_instead_of_any_6803": "将 catch 子句变量键入为 “unknown” 而不是 “any”。",
|
|
1540
1540
|
"Type_declaration_files_to_be_included_in_compilation_6124": "要包含在编译中类型声明文件。",
|
|
1541
1541
|
"Type_expected_1110": "应为类型。",
|
|
1542
|
+
"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456": "类型导入断言应恰好有一个键 - \"resolution-mode\" - 值为 \"import\" 或 \"require\"。",
|
|
1542
1543
|
"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589": "类型实例化过深,且可能无限。",
|
|
1543
1544
|
"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062": "类型在其自身的 \"then\" 方法的 fulfillment 回调中被直接或间接引用。",
|
|
1544
1545
|
"Type_library_referenced_via_0_from_file_1_1402": "通过 \"{0}\" 从文件 \"{1}\" 引用了库类型",
|
|
@@ -1781,6 +1782,8 @@
|
|
|
1781
1782
|
"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "\"readonly\" 修饰符仅可出现在属性声明或索引签名中。",
|
|
1782
1783
|
"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354": "仅允许对数组和元组文本类型使用 \"readonly\" 类型修饰符。",
|
|
1783
1784
|
"require_call_may_be_converted_to_an_import_80005": "可将“要求”调用转换为导入。",
|
|
1785
|
+
"resolution_mode_can_only_be_set_for_type_only_imports_1454": "只能为仅类型导入设置 \"resolution-mode\"。",
|
|
1786
|
+
"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455": "\"resolution-mode\" 是类型导入断言的唯一有效密钥。",
|
|
1784
1787
|
"resolution_mode_should_be_either_require_or_import_1453": "“resolution-mode”应为“require”或“import”。",
|
|
1785
1788
|
"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": "设置了 \"rootDirs\" 选项,可将其用于解析相对模块名称“{0}”。",
|
|
1786
1789
|
"super_can_only_be_referenced_in_a_derived_class_2335": "只能在派生类中引用 \"super\"。",
|
|
@@ -1539,6 +1539,7 @@
|
|
|
1539
1539
|
"Type_catch_clause_variables_as_unknown_instead_of_any_6803": "將 catch 子句變數輸入為 'unknown' 而非 'any'。",
|
|
1540
1540
|
"Type_declaration_files_to_be_included_in_compilation_6124": "要包含在編譯內的類型宣告檔案。",
|
|
1541
1541
|
"Type_expected_1110": "必須是類型。",
|
|
1542
|
+
"Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456": "輸入匯入判斷提示應該只有一個索引鍵 - 'resolution-mode' - 值為 'import' 或 'require'。",
|
|
1542
1543
|
"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589": "類型具現化過深,可能會有無限深度。",
|
|
1543
1544
|
"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062": "類型在其本身 'then' 方法的完成回撥中直接或間接受到參考。",
|
|
1544
1545
|
"Type_library_referenced_via_0_from_file_1_1402": "透過 '{0}' 從檔案 '{1}' 參考的型別程式庫",
|
|
@@ -1781,6 +1782,8 @@
|
|
|
1781
1782
|
"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "'readonly' 修飾元只能出現在屬性宣告或索引簽章。",
|
|
1782
1783
|
"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354": "'readonly' 類型修飾元只可用於陣列與元組常值類型。",
|
|
1783
1784
|
"require_call_may_be_converted_to_an_import_80005": "'require' 呼叫可能會轉換為匯入。",
|
|
1785
|
+
"resolution_mode_can_only_be_set_for_type_only_imports_1454": "只能針對僅限輸入的匯入設定 'resolution-mode'。",
|
|
1786
|
+
"resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455": "'resolution-mode' 是輸入匯入判斷提示唯一有效的索引鍵。",
|
|
1784
1787
|
"resolution_mode_should_be_either_require_or_import_1453": "`resolution-mode` 應該是 `require` 或 `import`。",
|
|
1785
1788
|
"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": "'rootDirs' 選項已設定。該選項將用於解析相對的模組名稱 '{0}'。",
|
|
1786
1789
|
"super_can_only_be_referenced_in_a_derived_class_2335": "只有衍生類別中才可參考 'super'。",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.7.0-dev.
|
|
5
|
+
"version": "4.7.0-dev.20220306",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|