typescript 4.7.0-dev.20220304 → 4.7.0-dev.20220305
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/de/diagnosticMessages.generated.json +3 -0
- package/lib/fr/diagnosticMessages.generated.json +3 -0
- package/lib/ja/diagnosticMessages.generated.json +3 -0
- package/lib/ko/diagnosticMessages.generated.json +3 -0
- package/lib/lib.es2020.intl.d.ts +1 -1
- package/lib/pt-br/diagnosticMessages.generated.json +3 -0
- package/lib/ru/diagnosticMessages.generated.json +3 -0
- package/lib/tsc.js +123 -31
- package/lib/tsserver.js +128 -34
- package/lib/tsserverlibrary.js +128 -34
- package/lib/typescript.js +128 -34
- package/lib/typescriptServices.js +128 -34
- package/lib/typingsInstaller.js +124 -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/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220305";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -39236,7 +39236,8 @@ var ts;
|
|
|
39236
39236
|
name: "jsxFragmentFactory",
|
|
39237
39237
|
type: "string",
|
|
39238
39238
|
category: ts.Diagnostics.Language_and_Environment,
|
|
39239
|
-
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment
|
|
39239
|
+
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,
|
|
39240
|
+
defaultValueDescription: "React.Fragment",
|
|
39240
39241
|
},
|
|
39241
39242
|
{
|
|
39242
39243
|
name: "jsxImportSource",
|
|
@@ -44325,7 +44326,7 @@ var ts;
|
|
|
44325
44326
|
return ts.isDottedName(expr)
|
|
44326
44327
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44327
44328
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44328
|
-
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44329
|
+
|| ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression)
|
|
44329
44330
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44330
44331
|
}
|
|
44331
44332
|
function containsNarrowableReference(expr) {
|
|
@@ -52561,7 +52562,15 @@ var ts;
|
|
|
52561
52562
|
});
|
|
52562
52563
|
}
|
|
52563
52564
|
}
|
|
52564
|
-
if (
|
|
52565
|
+
if (symbolName === undefined) {
|
|
52566
|
+
var name = ts.firstDefined(symbol.declarations, ts.getNameOfDeclaration);
|
|
52567
|
+
if (name && ts.isComputedPropertyName(name) && ts.isEntityName(name.expression)) {
|
|
52568
|
+
var LHS = createAccessFromSymbolChain(chain, index - 1, stopper);
|
|
52569
|
+
if (ts.isEntityName(LHS)) {
|
|
52570
|
+
return ts.factory.createIndexedAccessTypeNode(ts.factory.createParenthesizedType(ts.factory.createTypeQueryNode(LHS)), ts.factory.createTypeQueryNode(name.expression));
|
|
52571
|
+
}
|
|
52572
|
+
return LHS;
|
|
52573
|
+
}
|
|
52565
52574
|
symbolName = getNameOfSymbolAsWritten(symbol, context);
|
|
52566
52575
|
}
|
|
52567
52576
|
context.approximateLength += symbolName.length + 1;
|
|
@@ -65301,7 +65310,7 @@ var ts;
|
|
|
65301
65310
|
var requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source);
|
|
65302
65311
|
var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false);
|
|
65303
65312
|
if (unmatchedProperty) {
|
|
65304
|
-
if (reportErrors) {
|
|
65313
|
+
if (reportErrors && shouldReportUnmatchedPropertyError(source, target)) {
|
|
65305
65314
|
reportUnmatchedProperty(source, target, unmatchedProperty, requireOptionalProperties);
|
|
65306
65315
|
}
|
|
65307
65316
|
return 0 /* False */;
|
|
@@ -65457,6 +65466,19 @@ var ts;
|
|
|
65457
65466
|
}
|
|
65458
65467
|
return result;
|
|
65459
65468
|
}
|
|
65469
|
+
function shouldReportUnmatchedPropertyError(source, target) {
|
|
65470
|
+
var typeCallSignatures = getSignaturesOfStructuredType(source, 0 /* Call */);
|
|
65471
|
+
var typeConstructSignatures = getSignaturesOfStructuredType(source, 1 /* Construct */);
|
|
65472
|
+
var typeProperties = getPropertiesOfObjectType(source);
|
|
65473
|
+
if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) {
|
|
65474
|
+
if ((getSignaturesOfType(target, 0 /* Call */).length && typeCallSignatures.length) ||
|
|
65475
|
+
(getSignaturesOfType(target, 1 /* Construct */).length && typeConstructSignatures.length)) {
|
|
65476
|
+
return true; // target has similar signature kinds to source, still focus on the unmatched property
|
|
65477
|
+
}
|
|
65478
|
+
return false;
|
|
65479
|
+
}
|
|
65480
|
+
return true;
|
|
65481
|
+
}
|
|
65460
65482
|
function reportIncompatibleCallSignatureReturn(siga, sigb) {
|
|
65461
65483
|
if (siga.parameters.length === 0 && sigb.parameters.length === 0) {
|
|
65462
65484
|
return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source), typeToString(target)); };
|
|
@@ -68032,8 +68054,9 @@ var ts;
|
|
|
68032
68054
|
return isMatchingReference(source.expression, target);
|
|
68033
68055
|
case 205 /* PropertyAccessExpression */:
|
|
68034
68056
|
case 206 /* ElementAccessExpression */:
|
|
68035
|
-
|
|
68036
|
-
|
|
68057
|
+
var sourcePropertyName = getAccessedPropertyName(source);
|
|
68058
|
+
var targetPropertyName = ts.isAccessExpression(target) ? getAccessedPropertyName(target) : undefined;
|
|
68059
|
+
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68037
68060
|
isMatchingReference(source.expression, target.expression);
|
|
68038
68061
|
case 160 /* QualifiedName */:
|
|
68039
68062
|
return ts.isAccessExpression(target) &&
|
|
@@ -68045,12 +68068,49 @@ var ts;
|
|
|
68045
68068
|
return false;
|
|
68046
68069
|
}
|
|
68047
68070
|
function getAccessedPropertyName(access) {
|
|
68048
|
-
|
|
68049
|
-
|
|
68050
|
-
|
|
68051
|
-
|
|
68052
|
-
|
|
68053
|
-
|
|
68071
|
+
if (ts.isPropertyAccessExpression(access)) {
|
|
68072
|
+
return access.name.escapedText;
|
|
68073
|
+
}
|
|
68074
|
+
if (ts.isElementAccessExpression(access)) {
|
|
68075
|
+
return tryGetElementAccessExpressionName(access);
|
|
68076
|
+
}
|
|
68077
|
+
if (ts.isBindingElement(access)) {
|
|
68078
|
+
var name = getDestructuringPropertyName(access);
|
|
68079
|
+
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68080
|
+
}
|
|
68081
|
+
if (ts.isParameter(access)) {
|
|
68082
|
+
return ("" + access.parent.parameters.indexOf(access));
|
|
68083
|
+
}
|
|
68084
|
+
return undefined;
|
|
68085
|
+
}
|
|
68086
|
+
function tryGetNameFromType(type) {
|
|
68087
|
+
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68088
|
+
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68089
|
+
}
|
|
68090
|
+
function tryGetElementAccessExpressionName(node) {
|
|
68091
|
+
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68092
|
+
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68093
|
+
}
|
|
68094
|
+
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68095
|
+
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68096
|
+
if (!symbol || !isConstVariable(symbol))
|
|
68097
|
+
return undefined;
|
|
68098
|
+
var declaration = symbol.valueDeclaration;
|
|
68099
|
+
if (declaration === undefined)
|
|
68100
|
+
return undefined;
|
|
68101
|
+
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68102
|
+
if (type) {
|
|
68103
|
+
var name = tryGetNameFromType(type);
|
|
68104
|
+
if (name !== undefined) {
|
|
68105
|
+
return name;
|
|
68106
|
+
}
|
|
68107
|
+
}
|
|
68108
|
+
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68109
|
+
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68110
|
+
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68111
|
+
}
|
|
68112
|
+
}
|
|
68113
|
+
return undefined;
|
|
68054
68114
|
}
|
|
68055
68115
|
function containsMatchingReference(source, target) {
|
|
68056
68116
|
while (ts.isAccessExpression(source)) {
|
|
@@ -71556,11 +71616,21 @@ var ts;
|
|
|
71556
71616
|
}
|
|
71557
71617
|
return false;
|
|
71558
71618
|
}
|
|
71619
|
+
function uniqueStrings(strings) {
|
|
71620
|
+
var unique = new ts.Set(strings);
|
|
71621
|
+
var result = [];
|
|
71622
|
+
unique.forEach(function (str) { return result.push(str); });
|
|
71623
|
+
return result;
|
|
71624
|
+
}
|
|
71559
71625
|
function discriminateContextualTypeByObjectMembers(node, contextualType) {
|
|
71560
|
-
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.
|
|
71626
|
+
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) {
|
|
71627
|
+
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; });
|
|
71628
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71561
71629
|
}
|
|
71562
71630
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
71563
|
-
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.
|
|
71631
|
+
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) {
|
|
71632
|
+
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; });
|
|
71633
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71564
71634
|
}
|
|
71565
71635
|
// Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
|
|
71566
71636
|
// be "pushed" onto a node using the contextualType property.
|
|
@@ -73055,21 +73125,20 @@ var ts;
|
|
|
73055
73125
|
// of the property as base classes
|
|
73056
73126
|
var enclosingClass = forEachEnclosingClass(location, function (enclosingDeclaration) {
|
|
73057
73127
|
var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration));
|
|
73058
|
-
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing)
|
|
73128
|
+
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73059
73129
|
});
|
|
73060
73130
|
// A protected property is accessible if the property is within the declaring class or classes derived from it
|
|
73061
73131
|
if (!enclosingClass) {
|
|
73062
73132
|
// allow PropertyAccessibility if context is in function with this parameter
|
|
73063
|
-
// static member access is
|
|
73064
|
-
|
|
73065
|
-
|
|
73133
|
+
// static member access is disallowed
|
|
73134
|
+
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
73135
|
+
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73136
|
+
if (flags & 32 /* Static */ || !enclosingClass) {
|
|
73066
73137
|
if (errorNode) {
|
|
73067
73138
|
error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
73068
73139
|
}
|
|
73069
73140
|
return false;
|
|
73070
73141
|
}
|
|
73071
|
-
var thisType = getTypeFromTypeNode(thisParameter.type);
|
|
73072
|
-
enclosingClass = ((thisType.flags & 262144 /* TypeParameter */) ? getConstraintOfTypeParameter(thisType) : thisType).target;
|
|
73073
73142
|
}
|
|
73074
73143
|
// No further restrictions for static properties
|
|
73075
73144
|
if (flags & 32 /* Static */) {
|
|
@@ -73087,6 +73156,17 @@ var ts;
|
|
|
73087
73156
|
}
|
|
73088
73157
|
return true;
|
|
73089
73158
|
}
|
|
73159
|
+
function getEnclosingClassFromThisParameter(node) {
|
|
73160
|
+
var thisParameter = getThisParameterFromNodeContext(node);
|
|
73161
|
+
var thisType = (thisParameter === null || thisParameter === void 0 ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
|
|
73162
|
+
if (thisType && thisType.flags & 262144 /* TypeParameter */) {
|
|
73163
|
+
thisType = getConstraintOfTypeParameter(thisType);
|
|
73164
|
+
}
|
|
73165
|
+
if (thisType && ts.getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
|
|
73166
|
+
return getTargetType(thisType);
|
|
73167
|
+
}
|
|
73168
|
+
return undefined;
|
|
73169
|
+
}
|
|
73090
73170
|
function getThisParameterFromNodeContext(node) {
|
|
73091
73171
|
var thisContainer = ts.getThisContainer(node, /* includeArrowFunctions */ false);
|
|
73092
73172
|
return thisContainer && ts.isFunctionLike(thisContainer) ? ts.getThisParameter(thisContainer) : undefined;
|
|
@@ -75195,7 +75275,7 @@ var ts;
|
|
|
75195
75275
|
// then it cannot be instantiated.
|
|
75196
75276
|
// In the case of a merged class-module or class-interface declaration,
|
|
75197
75277
|
// only the class declaration node will have the Abstract flag set.
|
|
75198
|
-
if (constructSignatures
|
|
75278
|
+
if (someSignature(constructSignatures, function (signature) { return !!(signature.flags & 4 /* Abstract */); })) {
|
|
75199
75279
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
75200
75280
|
return resolveErrorCall(node);
|
|
75201
75281
|
}
|
|
@@ -75226,6 +75306,12 @@ var ts;
|
|
|
75226
75306
|
invocationError(node.expression, expressionType, 1 /* Construct */);
|
|
75227
75307
|
return resolveErrorCall(node);
|
|
75228
75308
|
}
|
|
75309
|
+
function someSignature(signatures, f) {
|
|
75310
|
+
if (ts.isArray(signatures)) {
|
|
75311
|
+
return ts.some(signatures, function (signature) { return someSignature(signature, f); });
|
|
75312
|
+
}
|
|
75313
|
+
return signatures.compositeKind === 1048576 /* Union */ ? ts.some(signatures.compositeSignatures, f) : f(signatures);
|
|
75314
|
+
}
|
|
75229
75315
|
function typeHasProtectedAccessibleBase(target, type) {
|
|
75230
75316
|
var baseTypes = getBaseTypes(type);
|
|
75231
75317
|
if (!ts.length(baseTypes)) {
|
|
@@ -77068,7 +77154,7 @@ var ts;
|
|
|
77068
77154
|
case 40 /* MinusToken */:
|
|
77069
77155
|
case 54 /* TildeToken */:
|
|
77070
77156
|
checkNonNullType(operandType, node.operand);
|
|
77071
|
-
if (
|
|
77157
|
+
if (maybeTypeOfKindConsideringBaseConstraint(operandType, 12288 /* ESSymbolLike */)) {
|
|
77072
77158
|
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
|
|
77073
77159
|
}
|
|
77074
77160
|
if (node.operator === 39 /* PlusToken */) {
|
|
@@ -77116,6 +77202,13 @@ var ts;
|
|
|
77116
77202
|
// If it's not a bigint type, implicit coercion will result in a number
|
|
77117
77203
|
return numberType;
|
|
77118
77204
|
}
|
|
77205
|
+
function maybeTypeOfKindConsideringBaseConstraint(type, kind) {
|
|
77206
|
+
if (maybeTypeOfKind(type, kind)) {
|
|
77207
|
+
return true;
|
|
77208
|
+
}
|
|
77209
|
+
var baseConstraint = getBaseConstraintOrType(type);
|
|
77210
|
+
return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind);
|
|
77211
|
+
}
|
|
77119
77212
|
// Return true if type might be of the given kind. A union or intersection type might be of a given
|
|
77120
77213
|
// kind if at least one constituent type is of the given kind.
|
|
77121
77214
|
function maybeTypeOfKind(type, kind) {
|
|
@@ -77825,8 +77918,8 @@ var ts;
|
|
|
77825
77918
|
}
|
|
77826
77919
|
// Return true if there was no error, false if there was an error.
|
|
77827
77920
|
function checkForDisallowedESSymbolOperand(operator) {
|
|
77828
|
-
var offendingSymbolOperand =
|
|
77829
|
-
|
|
77921
|
+
var offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left :
|
|
77922
|
+
maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right :
|
|
77830
77923
|
undefined;
|
|
77831
77924
|
if (offendingSymbolOperand) {
|
|
77832
77925
|
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
|
|
@@ -78030,7 +78123,7 @@ var ts;
|
|
|
78030
78123
|
for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
|
|
78031
78124
|
var span = _a[_i];
|
|
78032
78125
|
var type = checkExpression(span.expression);
|
|
78033
|
-
if (
|
|
78126
|
+
if (maybeTypeOfKindConsideringBaseConstraint(type, 12288 /* ESSymbolLike */)) {
|
|
78034
78127
|
error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);
|
|
78035
78128
|
}
|
|
78036
78129
|
texts.push(span.literal.text);
|
|
@@ -83057,7 +83150,7 @@ var ts;
|
|
|
83057
83150
|
}
|
|
83058
83151
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83059
83152
|
var propName = member.name;
|
|
83060
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83153
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
83061
83154
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83062
83155
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83063
83156
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83092,7 +83185,9 @@ var ts;
|
|
|
83092
83185
|
return false;
|
|
83093
83186
|
}
|
|
83094
83187
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83095
|
-
var reference = ts.
|
|
83188
|
+
var reference = ts.isComputedPropertyName(propName)
|
|
83189
|
+
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83190
|
+
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83096
83191
|
ts.setParent(reference.expression, reference);
|
|
83097
83192
|
ts.setParent(reference, constructor);
|
|
83098
83193
|
reference.flowNode = constructor.returnFlowNode;
|
|
@@ -92649,10 +92744,7 @@ var ts;
|
|
|
92649
92744
|
var substitute = typeof constantValue === "string" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue);
|
|
92650
92745
|
if (!compilerOptions.removeComments) {
|
|
92651
92746
|
var originalNode = ts.getOriginalNode(node, ts.isAccessExpression);
|
|
92652
|
-
|
|
92653
|
-
? ts.declarationNameToString(originalNode.name)
|
|
92654
|
-
: safeMultiLineComment(ts.getTextOfNode(originalNode.argumentExpression));
|
|
92655
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
|
|
92747
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + safeMultiLineComment(ts.getTextOfNode(originalNode)) + " ");
|
|
92656
92748
|
}
|
|
92657
92749
|
return substitute;
|
|
92658
92750
|
}
|
|
@@ -150853,8 +150945,10 @@ var ts;
|
|
|
150853
150945
|
var checker = program.getTypeChecker();
|
|
150854
150946
|
var compilerOptions = program.getCompilerOptions();
|
|
150855
150947
|
var symbolName = getSymbolName(sourceFile, checker, symbolToken, compilerOptions);
|
|
150856
|
-
// "default" is a keyword and not a legal identifier for the import,
|
|
150857
|
-
|
|
150948
|
+
// "default" is a keyword and not a legal identifier for the import, but appears as an identifier.
|
|
150949
|
+
if (symbolName === "default" /* Default */) {
|
|
150950
|
+
return undefined;
|
|
150951
|
+
}
|
|
150858
150952
|
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(symbolToken);
|
|
150859
150953
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
150860
150954
|
var exportInfo = getExportInfos(symbolName, ts.isJSXTagName(symbolToken), ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
|