@typescript-deploys/pr-build 5.1.0-pr-53549-16 → 5.1.0-pr-52840-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 +38 -32
- package/lib/tsserver.js +60 -45
- package/lib/tsserverlibrary.js +60 -45
- package/lib/typescript.js +60 -45
- package/lib/typingsInstaller.js +2 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -7740,7 +7740,8 @@ var Diagnostics = {
|
|
|
7740
7740
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7741
7741
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7742
7742
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7743
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7743
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7744
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
7744
7745
|
};
|
|
7745
7746
|
|
|
7746
7747
|
// src/compiler/scanner.ts
|
|
@@ -43383,8 +43384,6 @@ function createTypeChecker(host) {
|
|
|
43383
43384
|
var resolutionTargets = [];
|
|
43384
43385
|
var resolutionResults = [];
|
|
43385
43386
|
var resolutionPropertyNames = [];
|
|
43386
|
-
var resolutionStart = 0;
|
|
43387
|
-
var inVarianceComputation = false;
|
|
43388
43387
|
var suggestionCount = 0;
|
|
43389
43388
|
var maximumSuggestionCount = 10;
|
|
43390
43389
|
var mergedSymbols = [];
|
|
@@ -50585,7 +50584,7 @@ function createTypeChecker(host) {
|
|
|
50585
50584
|
return true;
|
|
50586
50585
|
}
|
|
50587
50586
|
function findResolutionCycleStartIndex(target, propertyName) {
|
|
50588
|
-
for (let i = resolutionTargets.length - 1; i >=
|
|
50587
|
+
for (let i = resolutionTargets.length - 1; i >= 0; i--) {
|
|
50589
50588
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
50590
50589
|
return -1;
|
|
50591
50590
|
}
|
|
@@ -61621,11 +61620,6 @@ function createTypeChecker(host) {
|
|
|
61621
61620
|
const links = getSymbolLinks(symbol);
|
|
61622
61621
|
if (!links.variances) {
|
|
61623
61622
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
61624
|
-
const oldVarianceComputation = inVarianceComputation;
|
|
61625
|
-
if (!inVarianceComputation) {
|
|
61626
|
-
inVarianceComputation = true;
|
|
61627
|
-
resolutionStart = resolutionTargets.length;
|
|
61628
|
-
}
|
|
61629
61623
|
links.variances = emptyArray;
|
|
61630
61624
|
const variances = [];
|
|
61631
61625
|
for (const tp of typeParameters) {
|
|
@@ -61654,10 +61648,6 @@ function createTypeChecker(host) {
|
|
|
61654
61648
|
}
|
|
61655
61649
|
variances.push(variance);
|
|
61656
61650
|
}
|
|
61657
|
-
if (!oldVarianceComputation) {
|
|
61658
|
-
inVarianceComputation = false;
|
|
61659
|
-
resolutionStart = 0;
|
|
61660
|
-
}
|
|
61661
61651
|
links.variances = variances;
|
|
61662
61652
|
(_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) });
|
|
61663
61653
|
}
|
|
@@ -78217,8 +78207,9 @@ function createTypeChecker(host) {
|
|
|
78217
78207
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
78218
78208
|
}
|
|
78219
78209
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
78220
|
-
var _a2, _b, _c, _d;
|
|
78210
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
78221
78211
|
const baseProperties = getPropertiesOfType(baseType);
|
|
78212
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
78222
78213
|
basePropertyCheck:
|
|
78223
78214
|
for (const baseProperty of baseProperties) {
|
|
78224
78215
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -78244,20 +78235,34 @@ function createTypeChecker(host) {
|
|
|
78244
78235
|
continue basePropertyCheck;
|
|
78245
78236
|
}
|
|
78246
78237
|
}
|
|
78247
|
-
if (
|
|
78248
|
-
error(
|
|
78238
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
78239
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
78249
78240
|
derivedClassDecl,
|
|
78250
|
-
Diagnostics.
|
|
78251
|
-
|
|
78241
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
78242
|
+
typeToString(type),
|
|
78252
78243
|
typeToString(baseType)
|
|
78253
78244
|
);
|
|
78245
|
+
}
|
|
78246
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
78247
|
+
addRelatedInfo(
|
|
78248
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78249
|
+
createDiagnosticForNode(
|
|
78250
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
78251
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
78252
|
+
symbolToString(baseProperty),
|
|
78253
|
+
typeToString(baseType)
|
|
78254
|
+
)
|
|
78255
|
+
);
|
|
78254
78256
|
} else {
|
|
78255
|
-
|
|
78256
|
-
|
|
78257
|
-
|
|
78258
|
-
|
|
78259
|
-
|
|
78260
|
-
|
|
78257
|
+
addRelatedInfo(
|
|
78258
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78259
|
+
createDiagnosticForNode(
|
|
78260
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
78261
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
78262
|
+
typeToString(type),
|
|
78263
|
+
symbolToString(baseProperty),
|
|
78264
|
+
typeToString(baseType)
|
|
78265
|
+
)
|
|
78261
78266
|
);
|
|
78262
78267
|
}
|
|
78263
78268
|
}
|
|
@@ -78270,7 +78275,7 @@ function createTypeChecker(host) {
|
|
|
78270
78275
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
78271
78276
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
78272
78277
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
78273
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
78278
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
78274
78279
|
continue;
|
|
78275
78280
|
}
|
|
78276
78281
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -78279,8 +78284,8 @@ function createTypeChecker(host) {
|
|
|
78279
78284
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
78280
78285
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
78281
78286
|
} else if (useDefineForClassFields) {
|
|
78282
|
-
const uninitialized = (
|
|
78283
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
78287
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
78288
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
78284
78289
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
78285
78290
|
const propName = uninitialized.name;
|
|
78286
78291
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -88391,16 +88396,17 @@ function transformClassFields(context) {
|
|
|
88391
88396
|
if (isAssignmentExpression(node)) {
|
|
88392
88397
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
88393
88398
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
88394
|
-
const
|
|
88399
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
88395
88400
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
88396
|
-
return factory2.updateBinaryExpression(node,
|
|
88401
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
88397
88402
|
}
|
|
88398
|
-
|
|
88399
|
-
|
|
88403
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
88404
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
88405
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
88400
88406
|
if (info) {
|
|
88401
88407
|
return setTextRange(
|
|
88402
88408
|
setOriginalNode(
|
|
88403
|
-
createPrivateIdentifierAssignment(info,
|
|
88409
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
88404
88410
|
node
|
|
88405
88411
|
),
|
|
88406
88412
|
node
|
package/lib/tsserver.js
CHANGED
|
@@ -11233,7 +11233,8 @@ var Diagnostics = {
|
|
|
11233
11233
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
11234
11234
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
11235
11235
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11236
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
11236
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
11237
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
11237
11238
|
};
|
|
11238
11239
|
|
|
11239
11240
|
// src/compiler/scanner.ts
|
|
@@ -48025,8 +48026,6 @@ function createTypeChecker(host) {
|
|
|
48025
48026
|
var resolutionTargets = [];
|
|
48026
48027
|
var resolutionResults = [];
|
|
48027
48028
|
var resolutionPropertyNames = [];
|
|
48028
|
-
var resolutionStart = 0;
|
|
48029
|
-
var inVarianceComputation = false;
|
|
48030
48029
|
var suggestionCount = 0;
|
|
48031
48030
|
var maximumSuggestionCount = 10;
|
|
48032
48031
|
var mergedSymbols = [];
|
|
@@ -55227,7 +55226,7 @@ function createTypeChecker(host) {
|
|
|
55227
55226
|
return true;
|
|
55228
55227
|
}
|
|
55229
55228
|
function findResolutionCycleStartIndex(target, propertyName) {
|
|
55230
|
-
for (let i = resolutionTargets.length - 1; i >=
|
|
55229
|
+
for (let i = resolutionTargets.length - 1; i >= 0; i--) {
|
|
55231
55230
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
55232
55231
|
return -1;
|
|
55233
55232
|
}
|
|
@@ -66263,11 +66262,6 @@ function createTypeChecker(host) {
|
|
|
66263
66262
|
const links = getSymbolLinks(symbol);
|
|
66264
66263
|
if (!links.variances) {
|
|
66265
66264
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
66266
|
-
const oldVarianceComputation = inVarianceComputation;
|
|
66267
|
-
if (!inVarianceComputation) {
|
|
66268
|
-
inVarianceComputation = true;
|
|
66269
|
-
resolutionStart = resolutionTargets.length;
|
|
66270
|
-
}
|
|
66271
66265
|
links.variances = emptyArray;
|
|
66272
66266
|
const variances = [];
|
|
66273
66267
|
for (const tp of typeParameters) {
|
|
@@ -66296,10 +66290,6 @@ function createTypeChecker(host) {
|
|
|
66296
66290
|
}
|
|
66297
66291
|
variances.push(variance);
|
|
66298
66292
|
}
|
|
66299
|
-
if (!oldVarianceComputation) {
|
|
66300
|
-
inVarianceComputation = false;
|
|
66301
|
-
resolutionStart = 0;
|
|
66302
|
-
}
|
|
66303
66293
|
links.variances = variances;
|
|
66304
66294
|
(_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) });
|
|
66305
66295
|
}
|
|
@@ -82859,8 +82849,9 @@ function createTypeChecker(host) {
|
|
|
82859
82849
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
82860
82850
|
}
|
|
82861
82851
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
82862
|
-
var _a2, _b, _c, _d;
|
|
82852
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
82863
82853
|
const baseProperties = getPropertiesOfType(baseType);
|
|
82854
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
82864
82855
|
basePropertyCheck:
|
|
82865
82856
|
for (const baseProperty of baseProperties) {
|
|
82866
82857
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -82886,20 +82877,34 @@ function createTypeChecker(host) {
|
|
|
82886
82877
|
continue basePropertyCheck;
|
|
82887
82878
|
}
|
|
82888
82879
|
}
|
|
82889
|
-
if (
|
|
82890
|
-
error(
|
|
82880
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
82881
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
82891
82882
|
derivedClassDecl,
|
|
82892
|
-
Diagnostics.
|
|
82893
|
-
|
|
82883
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
82884
|
+
typeToString(type),
|
|
82894
82885
|
typeToString(baseType)
|
|
82895
82886
|
);
|
|
82887
|
+
}
|
|
82888
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
82889
|
+
addRelatedInfo(
|
|
82890
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82891
|
+
createDiagnosticForNode(
|
|
82892
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
82893
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
82894
|
+
symbolToString(baseProperty),
|
|
82895
|
+
typeToString(baseType)
|
|
82896
|
+
)
|
|
82897
|
+
);
|
|
82896
82898
|
} else {
|
|
82897
|
-
|
|
82898
|
-
|
|
82899
|
-
|
|
82900
|
-
|
|
82901
|
-
|
|
82902
|
-
|
|
82899
|
+
addRelatedInfo(
|
|
82900
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82901
|
+
createDiagnosticForNode(
|
|
82902
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
82903
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
82904
|
+
typeToString(type),
|
|
82905
|
+
symbolToString(baseProperty),
|
|
82906
|
+
typeToString(baseType)
|
|
82907
|
+
)
|
|
82903
82908
|
);
|
|
82904
82909
|
}
|
|
82905
82910
|
}
|
|
@@ -82912,7 +82917,7 @@ function createTypeChecker(host) {
|
|
|
82912
82917
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
82913
82918
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
82914
82919
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
82915
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
82920
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
82916
82921
|
continue;
|
|
82917
82922
|
}
|
|
82918
82923
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -82921,8 +82926,8 @@ function createTypeChecker(host) {
|
|
|
82921
82926
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
82922
82927
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
82923
82928
|
} else if (useDefineForClassFields) {
|
|
82924
|
-
const uninitialized = (
|
|
82925
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
82929
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
82930
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
82926
82931
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
82927
82932
|
const propName = uninitialized.name;
|
|
82928
82933
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -93204,16 +93209,17 @@ function transformClassFields(context) {
|
|
|
93204
93209
|
if (isAssignmentExpression(node)) {
|
|
93205
93210
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
93206
93211
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
93207
|
-
const
|
|
93212
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
93208
93213
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
93209
|
-
return factory2.updateBinaryExpression(node,
|
|
93214
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
93210
93215
|
}
|
|
93211
|
-
|
|
93212
|
-
|
|
93216
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
93217
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
93218
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
93213
93219
|
if (info) {
|
|
93214
93220
|
return setTextRange(
|
|
93215
93221
|
setOriginalNode(
|
|
93216
|
-
createPrivateIdentifierAssignment(info,
|
|
93222
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
93217
93223
|
node
|
|
93218
93224
|
),
|
|
93219
93225
|
node
|
|
@@ -144839,8 +144845,7 @@ function getTypesPackageNameToInstall(packageName, host, diagCode) {
|
|
|
144839
144845
|
|
|
144840
144846
|
// src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts
|
|
144841
144847
|
var errorCodes30 = [
|
|
144842
|
-
Diagnostics.
|
|
144843
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
144848
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
144844
144849
|
];
|
|
144845
144850
|
var fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
144846
144851
|
registerCodeFix({
|
|
@@ -154205,7 +154210,7 @@ var Core;
|
|
|
154205
154210
|
((Core2) => {
|
|
154206
154211
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
154207
154212
|
var _a2, _b, _c;
|
|
154208
|
-
node =
|
|
154213
|
+
node = getAdjustedNode2(node, options);
|
|
154209
154214
|
if (isSourceFile(node)) {
|
|
154210
154215
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
154211
154216
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -154273,7 +154278,7 @@ var Core;
|
|
|
154273
154278
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
154274
154279
|
}
|
|
154275
154280
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
154276
|
-
function
|
|
154281
|
+
function getAdjustedNode2(node, options) {
|
|
154277
154282
|
if (options.use === 1 /* References */) {
|
|
154278
154283
|
node = getAdjustedReferenceLocation(node);
|
|
154279
154284
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -154281,7 +154286,7 @@ var Core;
|
|
|
154281
154286
|
}
|
|
154282
154287
|
return node;
|
|
154283
154288
|
}
|
|
154284
|
-
Core2.getAdjustedNode =
|
|
154289
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
154285
154290
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
154286
154291
|
var _a2, _b;
|
|
154287
154292
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -163095,8 +163100,11 @@ function countBinaryExpressionParameters(b) {
|
|
|
163095
163100
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
163096
163101
|
}
|
|
163097
163102
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
163098
|
-
const
|
|
163099
|
-
if (
|
|
163103
|
+
const node = getAdjustedNode(startingToken);
|
|
163104
|
+
if (node === void 0)
|
|
163105
|
+
return void 0;
|
|
163106
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
163107
|
+
if (info === void 0)
|
|
163100
163108
|
return void 0;
|
|
163101
163109
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
163102
163110
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -163109,16 +163117,23 @@ function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
|
163109
163117
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
163110
163118
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
163111
163119
|
}
|
|
163112
|
-
function
|
|
163113
|
-
|
|
163114
|
-
|
|
163115
|
-
|
|
163120
|
+
function getAdjustedNode(node) {
|
|
163121
|
+
switch (node.kind) {
|
|
163122
|
+
case 20 /* OpenParenToken */:
|
|
163123
|
+
case 27 /* CommaToken */:
|
|
163124
|
+
return node;
|
|
163125
|
+
default:
|
|
163126
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
163127
|
+
}
|
|
163128
|
+
}
|
|
163129
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
163130
|
+
const { parent: parent2 } = node;
|
|
163116
163131
|
switch (parent2.kind) {
|
|
163117
163132
|
case 215 /* ParenthesizedExpression */:
|
|
163118
163133
|
case 172 /* MethodDeclaration */:
|
|
163119
163134
|
case 216 /* FunctionExpression */:
|
|
163120
163135
|
case 217 /* ArrowFunction */:
|
|
163121
|
-
const info = getArgumentOrParameterListInfo(
|
|
163136
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
163122
163137
|
if (!info)
|
|
163123
163138
|
return void 0;
|
|
163124
163139
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -163127,7 +163142,7 @@ function getContextualSignatureLocationInfo(startingToken, sourceFile, position,
|
|
|
163127
163142
|
case 224 /* BinaryExpression */: {
|
|
163128
163143
|
const highestBinary = getHighestBinary(parent2);
|
|
163129
163144
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
163130
|
-
const argumentIndex2 =
|
|
163145
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
163131
163146
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
163132
163147
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
163133
163148
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
9059
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
9060
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -45833,8 +45834,6 @@ ${lanes.join("\n")}
|
|
|
45833
45834
|
var resolutionTargets = [];
|
|
45834
45835
|
var resolutionResults = [];
|
|
45835
45836
|
var resolutionPropertyNames = [];
|
|
45836
|
-
var resolutionStart = 0;
|
|
45837
|
-
var inVarianceComputation = false;
|
|
45838
45837
|
var suggestionCount = 0;
|
|
45839
45838
|
var maximumSuggestionCount = 10;
|
|
45840
45839
|
var mergedSymbols = [];
|
|
@@ -53035,7 +53034,7 @@ ${lanes.join("\n")}
|
|
|
53035
53034
|
return true;
|
|
53036
53035
|
}
|
|
53037
53036
|
function findResolutionCycleStartIndex(target, propertyName) {
|
|
53038
|
-
for (let i = resolutionTargets.length - 1; i >=
|
|
53037
|
+
for (let i = resolutionTargets.length - 1; i >= 0; i--) {
|
|
53039
53038
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
53040
53039
|
return -1;
|
|
53041
53040
|
}
|
|
@@ -64071,11 +64070,6 @@ ${lanes.join("\n")}
|
|
|
64071
64070
|
const links = getSymbolLinks(symbol);
|
|
64072
64071
|
if (!links.variances) {
|
|
64073
64072
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
64074
|
-
const oldVarianceComputation = inVarianceComputation;
|
|
64075
|
-
if (!inVarianceComputation) {
|
|
64076
|
-
inVarianceComputation = true;
|
|
64077
|
-
resolutionStart = resolutionTargets.length;
|
|
64078
|
-
}
|
|
64079
64073
|
links.variances = emptyArray;
|
|
64080
64074
|
const variances = [];
|
|
64081
64075
|
for (const tp of typeParameters) {
|
|
@@ -64104,10 +64098,6 @@ ${lanes.join("\n")}
|
|
|
64104
64098
|
}
|
|
64105
64099
|
variances.push(variance);
|
|
64106
64100
|
}
|
|
64107
|
-
if (!oldVarianceComputation) {
|
|
64108
|
-
inVarianceComputation = false;
|
|
64109
|
-
resolutionStart = 0;
|
|
64110
|
-
}
|
|
64111
64101
|
links.variances = variances;
|
|
64112
64102
|
(_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) });
|
|
64113
64103
|
}
|
|
@@ -80667,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80667
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80668
80658
|
}
|
|
80669
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80670
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80671
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80672
80663
|
basePropertyCheck:
|
|
80673
80664
|
for (const baseProperty of baseProperties) {
|
|
80674
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80694,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80694
80685
|
continue basePropertyCheck;
|
|
80695
80686
|
}
|
|
80696
80687
|
}
|
|
80697
|
-
if (
|
|
80698
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80699
80690
|
derivedClassDecl,
|
|
80700
|
-
Diagnostics.
|
|
80701
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80702
80693
|
typeToString(baseType)
|
|
80703
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80704
80706
|
} else {
|
|
80705
|
-
|
|
80706
|
-
|
|
80707
|
-
|
|
80708
|
-
|
|
80709
|
-
|
|
80710
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80711
80716
|
);
|
|
80712
80717
|
}
|
|
80713
80718
|
}
|
|
@@ -80720,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80720
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80721
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80722
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80723
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80724
80729
|
continue;
|
|
80725
80730
|
}
|
|
80726
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80729,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80729
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80730
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80731
80736
|
} else if (useDefineForClassFields) {
|
|
80732
|
-
const uninitialized = (
|
|
80733
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80734
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80735
80740
|
const propName = uninitialized.name;
|
|
80736
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91187,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91187
91192
|
if (isAssignmentExpression(node)) {
|
|
91188
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91189
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91190
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91191
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91192
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91193
91198
|
}
|
|
91194
|
-
|
|
91195
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91196
91202
|
if (info) {
|
|
91197
91203
|
return setTextRange(
|
|
91198
91204
|
setOriginalNode(
|
|
91199
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91200
91206
|
node
|
|
91201
91207
|
),
|
|
91202
91208
|
node
|
|
@@ -143562,8 +143568,7 @@ ${lanes.join("\n")}
|
|
|
143562
143568
|
init_ts4();
|
|
143563
143569
|
init_ts_codefix();
|
|
143564
143570
|
errorCodes30 = [
|
|
143565
|
-
Diagnostics.
|
|
143566
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143571
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143567
143572
|
];
|
|
143568
143573
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143569
143574
|
registerCodeFix({
|
|
@@ -153338,7 +153343,7 @@ ${lanes.join("\n")}
|
|
|
153338
153343
|
((Core2) => {
|
|
153339
153344
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153340
153345
|
var _a2, _b, _c;
|
|
153341
|
-
node =
|
|
153346
|
+
node = getAdjustedNode2(node, options);
|
|
153342
153347
|
if (isSourceFile(node)) {
|
|
153343
153348
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
153344
153349
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -153406,7 +153411,7 @@ ${lanes.join("\n")}
|
|
|
153406
153411
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
153407
153412
|
}
|
|
153408
153413
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
153409
|
-
function
|
|
153414
|
+
function getAdjustedNode2(node, options) {
|
|
153410
153415
|
if (options.use === 1 /* References */) {
|
|
153411
153416
|
node = getAdjustedReferenceLocation(node);
|
|
153412
153417
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -153414,7 +153419,7 @@ ${lanes.join("\n")}
|
|
|
153414
153419
|
}
|
|
153415
153420
|
return node;
|
|
153416
153421
|
}
|
|
153417
|
-
Core2.getAdjustedNode =
|
|
153422
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
153418
153423
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153419
153424
|
var _a2, _b;
|
|
153420
153425
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -162517,8 +162522,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162517
162522
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
162518
162523
|
}
|
|
162519
162524
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
162520
|
-
const
|
|
162521
|
-
if (
|
|
162525
|
+
const node = getAdjustedNode(startingToken);
|
|
162526
|
+
if (node === void 0)
|
|
162527
|
+
return void 0;
|
|
162528
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
162529
|
+
if (info === void 0)
|
|
162522
162530
|
return void 0;
|
|
162523
162531
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
162524
162532
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -162531,16 +162539,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162531
162539
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
162532
162540
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
162533
162541
|
}
|
|
162534
|
-
function
|
|
162535
|
-
|
|
162536
|
-
|
|
162537
|
-
|
|
162542
|
+
function getAdjustedNode(node) {
|
|
162543
|
+
switch (node.kind) {
|
|
162544
|
+
case 20 /* OpenParenToken */:
|
|
162545
|
+
case 27 /* CommaToken */:
|
|
162546
|
+
return node;
|
|
162547
|
+
default:
|
|
162548
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
162549
|
+
}
|
|
162550
|
+
}
|
|
162551
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
162552
|
+
const { parent: parent2 } = node;
|
|
162538
162553
|
switch (parent2.kind) {
|
|
162539
162554
|
case 215 /* ParenthesizedExpression */:
|
|
162540
162555
|
case 172 /* MethodDeclaration */:
|
|
162541
162556
|
case 216 /* FunctionExpression */:
|
|
162542
162557
|
case 217 /* ArrowFunction */:
|
|
162543
|
-
const info = getArgumentOrParameterListInfo(
|
|
162558
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
162544
162559
|
if (!info)
|
|
162545
162560
|
return void 0;
|
|
162546
162561
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -162549,7 +162564,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162549
162564
|
case 224 /* BinaryExpression */: {
|
|
162550
162565
|
const highestBinary = getHighestBinary(parent2);
|
|
162551
162566
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
162552
|
-
const argumentIndex2 =
|
|
162567
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
162553
162568
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
162554
162569
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
162555
162570
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
9059
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
9060
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -45833,8 +45834,6 @@ ${lanes.join("\n")}
|
|
|
45833
45834
|
var resolutionTargets = [];
|
|
45834
45835
|
var resolutionResults = [];
|
|
45835
45836
|
var resolutionPropertyNames = [];
|
|
45836
|
-
var resolutionStart = 0;
|
|
45837
|
-
var inVarianceComputation = false;
|
|
45838
45837
|
var suggestionCount = 0;
|
|
45839
45838
|
var maximumSuggestionCount = 10;
|
|
45840
45839
|
var mergedSymbols = [];
|
|
@@ -53035,7 +53034,7 @@ ${lanes.join("\n")}
|
|
|
53035
53034
|
return true;
|
|
53036
53035
|
}
|
|
53037
53036
|
function findResolutionCycleStartIndex(target, propertyName) {
|
|
53038
|
-
for (let i = resolutionTargets.length - 1; i >=
|
|
53037
|
+
for (let i = resolutionTargets.length - 1; i >= 0; i--) {
|
|
53039
53038
|
if (resolutionTargetHasProperty(resolutionTargets[i], resolutionPropertyNames[i])) {
|
|
53040
53039
|
return -1;
|
|
53041
53040
|
}
|
|
@@ -64071,11 +64070,6 @@ ${lanes.join("\n")}
|
|
|
64071
64070
|
const links = getSymbolLinks(symbol);
|
|
64072
64071
|
if (!links.variances) {
|
|
64073
64072
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
64074
|
-
const oldVarianceComputation = inVarianceComputation;
|
|
64075
|
-
if (!inVarianceComputation) {
|
|
64076
|
-
inVarianceComputation = true;
|
|
64077
|
-
resolutionStart = resolutionTargets.length;
|
|
64078
|
-
}
|
|
64079
64073
|
links.variances = emptyArray;
|
|
64080
64074
|
const variances = [];
|
|
64081
64075
|
for (const tp of typeParameters) {
|
|
@@ -64104,10 +64098,6 @@ ${lanes.join("\n")}
|
|
|
64104
64098
|
}
|
|
64105
64099
|
variances.push(variance);
|
|
64106
64100
|
}
|
|
64107
|
-
if (!oldVarianceComputation) {
|
|
64108
|
-
inVarianceComputation = false;
|
|
64109
|
-
resolutionStart = 0;
|
|
64110
|
-
}
|
|
64111
64101
|
links.variances = variances;
|
|
64112
64102
|
(_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) });
|
|
64113
64103
|
}
|
|
@@ -80667,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80667
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80668
80658
|
}
|
|
80669
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80670
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80671
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80672
80663
|
basePropertyCheck:
|
|
80673
80664
|
for (const baseProperty of baseProperties) {
|
|
80674
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80694,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80694
80685
|
continue basePropertyCheck;
|
|
80695
80686
|
}
|
|
80696
80687
|
}
|
|
80697
|
-
if (
|
|
80698
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80699
80690
|
derivedClassDecl,
|
|
80700
|
-
Diagnostics.
|
|
80701
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80702
80693
|
typeToString(baseType)
|
|
80703
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80704
80706
|
} else {
|
|
80705
|
-
|
|
80706
|
-
|
|
80707
|
-
|
|
80708
|
-
|
|
80709
|
-
|
|
80710
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80711
80716
|
);
|
|
80712
80717
|
}
|
|
80713
80718
|
}
|
|
@@ -80720,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80720
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80721
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80722
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80723
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80724
80729
|
continue;
|
|
80725
80730
|
}
|
|
80726
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80729,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80729
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80730
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80731
80736
|
} else if (useDefineForClassFields) {
|
|
80732
|
-
const uninitialized = (
|
|
80733
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80734
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80735
80740
|
const propName = uninitialized.name;
|
|
80736
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91187,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91187
91192
|
if (isAssignmentExpression(node)) {
|
|
91188
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91189
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91190
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91191
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91192
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91193
91198
|
}
|
|
91194
|
-
|
|
91195
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91196
91202
|
if (info) {
|
|
91197
91203
|
return setTextRange(
|
|
91198
91204
|
setOriginalNode(
|
|
91199
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91200
91206
|
node
|
|
91201
91207
|
),
|
|
91202
91208
|
node
|
|
@@ -143576,8 +143582,7 @@ ${lanes.join("\n")}
|
|
|
143576
143582
|
init_ts4();
|
|
143577
143583
|
init_ts_codefix();
|
|
143578
143584
|
errorCodes30 = [
|
|
143579
|
-
Diagnostics.
|
|
143580
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143585
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143581
143586
|
];
|
|
143582
143587
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143583
143588
|
registerCodeFix({
|
|
@@ -153352,7 +153357,7 @@ ${lanes.join("\n")}
|
|
|
153352
153357
|
((Core2) => {
|
|
153353
153358
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153354
153359
|
var _a2, _b, _c;
|
|
153355
|
-
node =
|
|
153360
|
+
node = getAdjustedNode2(node, options);
|
|
153356
153361
|
if (isSourceFile(node)) {
|
|
153357
153362
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
153358
153363
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -153420,7 +153425,7 @@ ${lanes.join("\n")}
|
|
|
153420
153425
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
153421
153426
|
}
|
|
153422
153427
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
153423
|
-
function
|
|
153428
|
+
function getAdjustedNode2(node, options) {
|
|
153424
153429
|
if (options.use === 1 /* References */) {
|
|
153425
153430
|
node = getAdjustedReferenceLocation(node);
|
|
153426
153431
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -153428,7 +153433,7 @@ ${lanes.join("\n")}
|
|
|
153428
153433
|
}
|
|
153429
153434
|
return node;
|
|
153430
153435
|
}
|
|
153431
|
-
Core2.getAdjustedNode =
|
|
153436
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
153432
153437
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153433
153438
|
var _a2, _b;
|
|
153434
153439
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -162531,8 +162536,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162531
162536
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
162532
162537
|
}
|
|
162533
162538
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
162534
|
-
const
|
|
162535
|
-
if (
|
|
162539
|
+
const node = getAdjustedNode(startingToken);
|
|
162540
|
+
if (node === void 0)
|
|
162541
|
+
return void 0;
|
|
162542
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
162543
|
+
if (info === void 0)
|
|
162536
162544
|
return void 0;
|
|
162537
162545
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
162538
162546
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -162545,16 +162553,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162545
162553
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
162546
162554
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
162547
162555
|
}
|
|
162548
|
-
function
|
|
162549
|
-
|
|
162550
|
-
|
|
162551
|
-
|
|
162556
|
+
function getAdjustedNode(node) {
|
|
162557
|
+
switch (node.kind) {
|
|
162558
|
+
case 20 /* OpenParenToken */:
|
|
162559
|
+
case 27 /* CommaToken */:
|
|
162560
|
+
return node;
|
|
162561
|
+
default:
|
|
162562
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
162563
|
+
}
|
|
162564
|
+
}
|
|
162565
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
162566
|
+
const { parent: parent2 } = node;
|
|
162552
162567
|
switch (parent2.kind) {
|
|
162553
162568
|
case 215 /* ParenthesizedExpression */:
|
|
162554
162569
|
case 172 /* MethodDeclaration */:
|
|
162555
162570
|
case 216 /* FunctionExpression */:
|
|
162556
162571
|
case 217 /* ArrowFunction */:
|
|
162557
|
-
const info = getArgumentOrParameterListInfo(
|
|
162572
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
162558
162573
|
if (!info)
|
|
162559
162574
|
return void 0;
|
|
162560
162575
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -162563,7 +162578,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162563
162578
|
case 224 /* BinaryExpression */: {
|
|
162564
162579
|
const highestBinary = getHighestBinary(parent2);
|
|
162565
162580
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
162566
|
-
const argumentIndex2 =
|
|
162581
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
162567
162582
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
162568
162583
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
162569
162584
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -7120,7 +7120,8 @@ var Diagnostics = {
|
|
|
7120
7120
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7121
7121
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7122
7122
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7123
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7123
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7124
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
7124
7125
|
};
|
|
7125
7126
|
|
|
7126
7127
|
// src/compiler/scanner.ts
|
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-52840-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": "23770b0defac3e1a7e70e24a5ece622625a10321"
|
|
118
118
|
}
|